How do I model a has_many :through and with aggregation in Rails?
- by Angela
How do I model having multiple Addresses for a Company and assign a single Address to a Contact?
Contacts belong_to a Company.
A Company has_many Contacts.
A Company also has_many Addresses.
And each Contact belongs_to an Address.
How do I model this?
I have
Model/Contacts.rb
belong_to :Company
belong_to :Address (?)
Model/Company.rb
…