In Rails 5, they have added the ActiveRecord query method left_joins
. What\'s the difference between left_joins
and includes
? I\'ve alway
includes by default loads the association data in 2 queries just like preload.
But with additional references call it switches from using two separate queries to creating a single LEFT OUTER JOIN
like left_joins.
Refs:
Preload, Eagerload, Includes and Joins
Making sense of ActiveRecord joins, includes, preload, and eager_load