The legacy_triple_equals flag is used incorrectly in our code:
def ===(other) if Mongoid.legacy_triple_equals super else other.class == Class ? self.class === other : self == other end end
When legacy_triple_equals is true, we should use the old behavior, and when it is false, we should delegate to super. We are getting the incorrect behavior:
irb(main):003:0> Band.new === Band => true irb(main):004:0> Mongoid.legacy_triple_equals => false irb(main):005:0> Mongoid.legacy_triple_equals = true => true irb(main):006:0> Band.new === Band => false
Our documentation says the reverse is true.