4 ms·
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.
by amingilani 9y ago
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.