Preloading associations on an Array of Objects

Author:
Source

It might happen that your initial array of objects is not an ActiveRecord Relation.
You cannot use preload on an array of objects and therefore you suffer of N+1 queries.
Here is a smart way to solve the problem!

Read more