Mario Gr wrote:
> Hi,
> 
> I am trying to combine results on two related associations and was
> wondering if there were a best practicies way to do this.
> 
> I basically have VendorCodes that are matched to both Vendors and
> VendorStaff.
> 
> vendors have VendorCodes (polymorphic)
> vendorStaffs have VendoorCodes  (polymorphic)
> 
> I want to easily be able to derive something like:
> all_vendor_codes = vendor.vendor_codes +
> vendor.vendor_staffs.collect.vendor_code

Is there any reason that you can't just do VendorCode.all ?

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to