Understanding Rails Eager-Loading
24-Jun-2019 1608
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 #Understanding #Rails #Eager-Loading https://rubyonrails.ba/link/understanding-rails-eager-loading