mongoid/mongoid — pull request #2671 by jonhyman (2013-01-06 16:17:59+00:00)
Title: Allow matches? to work with symbol keys in the selector.

`#matches?` was failing me due to having symbol keys in the selector. That is:

```ruby
class Book
include Mongoid::Document
field :pages, :type => Integer
end

b = Book.create(:pages => 10)
b.matches?(:pages => {:$gt => 5})
# => false
```

If I change `:$gt` to `"$gt"` it works fine.

This pull request allows you to specify :$gt or "$gt" as your selector key.

I added somewhat of a narrow spec for this by only testing one operation: I wasn't sure if you want to test every single operation ($in, $gte, $nin, $in, $all, etc.) for this change because it might clutter up the tests for the same fix, but let me know and I can add additional ones.