2 comments

[ 3.4 ms ] story [ 12.9 ms ] thread
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.