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