mongoid/mongoid — Issue #1579: Criteria for querying Sets is invalid
Author: romanbsd
Created: 2012-01-10 15:19:34+00:00
State: open

Consider the following:

```ruby

field :roles, :type => Array
scope :admins, any_in('roles' => ['admin'])
```

it works as expected and produces the following criteria:

#<Mongoid::Criteria
selector: {"roles"=>{"$in"=>["admin"]}},
options: {},
class: User,
embedded: false>

now, if I change the Array to Set, e.g. field :roles, :type => Set , then the produced criteria is wrong:

#<Mongoid::Criteria
selector: {"roles"=>{"$in"=>[[["admin"]]]}},
options: {},
class: User,
embedded: false>