-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
When an operator method is called repeatedly it overwrites the previous conditions of the same method. The new conditions should be added to the existing ones.
Current behavior:
irb(main):024:0> c=Person.gt(age: 2).gt(age: 1); c => #<Mongoid::Criteria selector: {"age"=>{"$gt"=>1}} options: {} class: Person embedded: false>
Expected something like:
=> #<Mongoid::Criteria selector: {"age"=>{"$gt"=>2}, "$and"=>[{"age"=>{"$gt"=>1}}]} options: {} class: Person embedded: false>
- is related to
-
MONGOID-5349 Implement merge strategies for all operators
-
- Blocked
-
- related to
-
MONGOID-5329 Ability to remove default scope from Criteria
-
- Backlog
-