not creates incorrect queries when symbol operators are given

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 7.1.2
    • Affects Version/s: None
    • Component/s: Query
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When not is used with symbol operators, the resulting queries are incorrect:

      irb(main):001:0> Band.not(:age.gt => 3)
      => 
      #<Mongoid::Criteria
        selector: {"age"=>{"$ne"=>3}}
        options:  {}
        class:    Band
        embedded: false>
      
      

      Expected behavior:

      irb(main):001:0>  Band.not(:age.gt => 3)
      => 
      #<Mongoid::Criteria
        selector: {"$and"=>[{"$nor"=>[{"age"=>{"$gt"=>3}}]}]}
        options:  {}
        class:    Band
        embedded: false>
      
      

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

                Created:
                Updated:
                Resolved: