Easy to Overlook Way to Break Eager Loading in Rails Apps
13-Jan-2023 814
In theory, configuring eager loading to avoid N 1 issues is straightforward. Chaining includes method is usually enough to ensure that all the relations data is fetched efficiently. However, this rule breaks for some easy-to-overlook edge cases. In this blog post, I’ll describe how to eager load ActiveRecord relations using custom SQL ORDER BY sorting.
Easy to Overlook Way to Break Eager Loading in Rails Apps #ruby #rubydeveloper #rubyonrails #Overlook #Break #Eager #Loading #Rails https://rubyonrails.ba/link/easy-to-overlook-way-to-break-eager-loading-in-rails-apps