Ryan Bigg wrote:
Please use "real" names in your examples as it helps us to provide
more accurate information. For example, I don't know what kind of
association table2 has with table1, so I've treated it as a belongs_to.
Here's what I have for my code.
I want to find all of the active users and then from there, get all of
the committees that each person is on.
So do I need to set up the has_many and belongs_to relationships for
Secondly, I am easily able to make the first piece of code work.
@user_list = User.find(:all, :select => "id, active", :conditions =>
["active =>", true], :include => "committees")
This gives me [#<User id:1, Active: true>, #<User id:2, Active: true>,
#<User id:3, Active: true>]
But I'm not able to make the second part of this work to get the list of
committees for each user.