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

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -