Hi, after upgrading Mongoid to 8.1, eager-loading doesn't work for me in this case:
class Channel
belongs_to :organization
end
class ManagerChannel < Channel; end
Channel.includes(:organization).map(&:organization) # works
Channel.where(_type: 'ManagerChannel').includes(:organization).map(&:organization) # works
ManagerChannel.includes(:organization).map(&:organization) # doesn't work (n+1 queries)
I have another model with the same behavior.
I'm on 8.1.8, but can reproduce it on 8.0.1 too.
- depends on
-
MONGOID-5840 Inefficient Query Behavior with includes on Inherited Classes in Mongoid 8.0.8
-
- Closed
-