eager loading - rails eager_load from multiple association with different condition -
complex_participators = participators.eager_load(:activities).where("archieved = ? , pattern = ?", true, 'match') complex_participators = participators.eager_load(:free_times).where(activity_id: id).order("participators.id asc, free_times.start asc") complex_participators.each {|p| ...}
i want complex_participators
array, each p have activities objects , free_times objects loaded
how can this?
Comments
Post a Comment