Don’t use default_scope. Ever
andycroll.com
andycroll.com
There is one usecase where this works, though.
class Post < ActiveRecord::Base
default_scope { include(:author) }
end
In my case, the parent model depended on the child-model to be present when running a few methods (calculating the total for line items), so I decided to do this for eager loading.