Hello, I have a class, say called Customer, which has the following two members (instance variables), CoreControls and OptionalControls. Both CoreControls and OptionalControls are of the type PropertyCollection, where PropertyCollection represents an array of a composite data type. I would be grateful for suggestion on how I might implement this from a database and model perspective? Thanks. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
I ended up adding two ''belongs_to'' declarations to my Customer
class
and this did the trick.
belongs_to :optionalControls
:class_name => "PropertyControlCollection",
:foreign_key => "optional_control_id"
belongs_to :coreControls
:class_name => "PropertyControlCollection",
:foreign_key => "core_control_id"
plus of course the foreign keys to my "customers" table.
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---