Categories
Programming

Goldiloader: “Just In Time” Eager Loading Gem for ActiveRecord

Typically to eager load in Rails you use the .includes(:xyz) method in the controller code (or wherever you are making the search call)

Here’s an interesting solution that does “just in time” loading based on how the view will render, eliminating the need to put includes into your AR queries.

Haven’t use it but it looks pretty cool.

https://github.com/salsify/goldiloader