Ruby on Rails Monday, August 23, 2010

in my models, household has_many :people and people has_one :household
household has a name field, and people has household_id

the closest I got was:
@test = Household.count :all, :group => 'people.household_id', :joins
=> :people

this does group the families together and count the members,
but this has no way of including only families of one
I am assuming that the output from this could be used to get the name
field from households

--
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