-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
order_criteria = Order.desc(:name) => #<Mongoid::Criteria selector: {:deleted_at=>nil}, options: {:sort=>[[:name, :desc]]}, class: Order, embedded: false> order_criteria.first => #<Order _id: 4e8e8b169759f77a73000001 ... > order_criteria => #<Mongoid::Criteria selector: {:deleted_at=>nil}, options: {:sort=>[[:name, :desc], [:_id, :asc]]}, class: Order, embedded: false>
And even more curious:
order_criteria = Order.desc(:_id) => #<Mongoid::Criteria selector: {:deleted_at=>nil}, options: {:sort=>[[:_id, :desc]]}, class: Order, embedded: false> order_criteria.first => #<Order _id: 4e8e8b169759f77a73000001 ... > order_criteria => #<Mongoid::Criteria selector: {:deleted_at=>nil}, options: {:sort=>[[:_id, :desc], [:_id, :asc]]}, class: Order, embedded: false>
I think these methods better should work with duplicates of criterion