.where (or scopes) on associations triggers queries even if the association has already been loaded. @justinweiss wrote a great article about converting scopes to associations to fix this common N+1 cause: https://www.justinweiss.com/articles/how-to-preload-rails-scopes/ … I tend to just use Enumerable (`select`) if poss.
Replying to @nateberkopec @justinweiss
Depending on the number of filtered records, the cost of sending them over the wire, deserializing into Ruby objects, and filtering may be non trivial
1:08 PM - 15 Aug 2018
0 replies
0 retweets
3 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.