Open subvertallchris opened 9 years ago
Definitely would be great! One thing to caution (perhaps in the docs) is that people should be very careful about how they use this. In a previous job somebody put a bunch of eager loads into the default_scope
of a model to speed up some pages, but then we were loading unnecessary data on a lot of other pages.
Was looking into another issue and realizing that we need unscoped
both for this but also so that we can refer to all nodes within a class method / scope
A request from a friend at work.
It'd be nice to be able to set a default scope in models like you can in ActiveRecord. http://api.rubyonrails.org/classes/ActiveRecord/Scoping/Default/ClassMethods.html#method-i-default_scope