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

Popular posts from this blog

c++ - CPP, 'X' button listener -

.net - Bulk insert via Dapper is slower than inserting rows one-by-one -

shared memory - gstreamer shmsrc and shmsink with h264 data -