I've got two models:
Customer
and Contact
Customers
table has columns :id, :firstName, :lastName
Contacts
table has columns :id, :cid, :hphone, :cphone
So if Customers table has data
1 Josh McDonnel
Then Contacts table has corresponding
5 1 947-245-2342 342-543-8585
What associations can I use here?
Will Contact have
belongs_to :customer, :foreign_key => "id", :class_name => "Customer"
What should the Customer class have?
Also, how will a simple find_byXXX
look like if I want to get all customers (firstName
, lastName
and corresponding hphone
and cphone
)