lee
1
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.
lee
2
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.