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

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -