mongoid/mongoid — Issue #1346: #first and #last change previous criteria
Author: Mik-die
Created: 2011-10-13 10:18:16+00:00
State: open

```
order_criteria = Order.desc(:name)
=> #nil},
options: {:sort=>[[:name, :desc]]},
class: Order,
embedded: false>

ruby-1.9.2-p290 :053 > order_criteria.first
=> #

ruby-1.9.2-p290 :054 > order_criteria
=> #nil},
options: {:sort=>[[:name, :desc], [:_id, :asc]]},
class: Order,
embedded: false>
```

And even more curious:

```
order_criteria = Order.desc(:_id)
=> #nil},
options: {:sort=>[[:_id, :desc]]},
class: Order,
embedded: false>

ruby-1.9.2-p290 :053 > order_criteria.first
=> #

ruby-1.9.2-p290 :054 > order_criteria
=> #nil},
options: {:sort=>[[:_id, :desc], [:_id, :asc]]},
class: Order,
embedded: false>
```

I think these methods better should work with duplicates of criterion