Ruby on Rails Thursday, December 30, 2010

Here are my tables

patients
id name
1 Bob
2 Carol
3 Ted
4 Reggie

families
family_id patient_id
1 1
1 2
2 3
2 4

How do I structure the model associations so that I can
@patient.family.patient[0].name?

Make sense?

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment