Omit $or operator when it has only one condition

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Query
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      or() with a single argument should simply place that argument as the top level condition, not nested under $or.

      Current behavior:

      irb(main):009:0> Band.or(year: 1)
      => 
      #<Mongoid::Criteria
        selector: {"$or"=>[{"year"=>1}]}
        options:  {}
        class:    Band
        embedded: false>
      
      

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

              Created:
              Updated: