legacy_triple_equals used incorrectly

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Unknown
    • 8.1.0, 8.0.2, 7.5.1, 7.4.3
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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. 

              Assignee:
              Neil Shweky (Inactive)
              Reporter:
              Neil Shweky (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: