i was hoping someone could help me out with a small yet quite
time-boggling task…i have a two tables users, groups joined in as a
habtam relashinship (has and belongs to many) and i need to select from
the mydb (mysql if it matters) users out of the User model, in
accordance with TWO groups in one rails opperation to improve
performance…basicly, say i have ten groups and ten users, and i wanted
to take out seven(or whatever) of the ten users that are associated with
two groups(1 and 2) in one select operation.
i don’t know if this is possible but this is kind of what i was
@users_associated_with_group1_and_group2 = User.find(:all, :include =>
‘groups’, :group => ‘1 and 2’, :conditions => :group)
or something of this sort…i actually need to do this with a couple of
different groups that will dynamicly change with the application(not
just two static groups)
is this possible?
much thanks ahead of time,