Saturday, August 26, 2017

Eager Loading Polymorphic Associations with Ruby on Rails



Efficiently eager loading polymorphic associations to avoid the 'n-plus-one' queries can be a challenge. Consider the following example: Attempting to eager load the authors or directors for the books or films is slightly more challenging.

No comments:

The Y Combinator (Slight Return)

Tiger got to hunt, Bird got to fly; Lisper got to sit and wonder, (Y (Y Y))? Tiger got to sleep, Bird got to land; Lisper got to tell hims...