amatsuda/kaminari — Issue #215: Strange criteria when searching on _id with mongoid
Author: alexistoulotte
Created: 2012-03-07 06:03:00+00:00
State: open

When using kaminari `#page` method with an `_id` criteria in mongoid it adds a strange `$and` operator. It has effect to return an empty collection.

>> Content.where(:_id => 'foo').criteria
=> #"foo"},
options: {},
class: Content,
embedded: false>

>> Content.where(:_id => 'foo').page(1).criteria
=> #[{:_id=>"foo"}, {:_id=>"foo"}], :_id=>"foo"},
options: {:limit=>25, :skip=>0},
class: Content,
embedded: false>