Understanding Rails Eager-Loading

Note: this is an article that I posted a few years ago on Medium. I'm reposting here as it's likely to be more useful to someone that way.If you're like me, nothing makes your eyes glaze over faster than a wet, steaming pile of machine-generated SQL. My aim was to write a Rails eager-loading guide that's heavy on motivation and light on log statements. Hopefully I can provide you with the explanation I never had.This post assumes that you understand model associations, are comfortable with JOINs, and are familiar with the N 1 query problem. If any of that sounds foreign, I recommend playing with plain SQL first (SELECT, JOIN, .
Understanding Rails Eager-Loading #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/understanding-rails-eager-loading

Nezir Zahirovic

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

related articles