$or condition is mishandled by Criteria#where

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Critical - P2
    • 7.1.1
    • Affects Version/s: None
    • Component/s: Query
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When an explicit $or is used with Criteria#where, the receiver is disjuncted as Criteria#or would operate:

      
      irb(main):008:0> Band.where(foo: 1).where('$or'=>[{hello:'world'}])
      => #<Mongoid::Criteria
        selector: {"$or"=>[{"foo"=>1}, {:hello=>"world"}]}
        options:  {}
        class:    Band
        embedded: false>
      
      
      

      What should happen is #where should always add conditions to the receiver.

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

              Created:
              Updated:
              Resolved: