Easy to Overlook Way to Break Eager Loading in Rails Apps

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 https://rubyonrails.ba/single/easy-to-overlook-way-to-break-eager-loading-in-rails-apps

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles