I think this is a simple problem, but i just cant get my head round the solution. If i have a collection of records (reports in this case):
@reports = Report.all, :conditions => ["score > 10"]
and then i try to find the associated collection of other type of records (users in this case) i, naively, try this – but know from the offset that it wont work:
@users = User.find :all, :conditions => ["id IN (?)", @results.user_id]
So, how do i efficiently extract the @users collection of records?
Assuming that
User has_many :reportsIf you only want all users for some specific reports