News for hackers. Stuff that matters.
Re:Don’t use default_scope. Ever by amingilani on Saturday October 07, 2017 @12:13PM (#15424323)
I ran into this recently. Almost the exact same usecase, although I had canceled line items, instead of posts.

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.

There are no comments on this comment yet.