RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Preloading Rails scopes

Rails’ scopes make it easy to find the records you want. But you can’t really preload a scope. So if you’re not careful, your scopes will turn into N+1 queries, which turns into slow controller actions. How can you keep that from happening?

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in