mongoid / origin

A Ruby DSL for building MongoDB queries
http://mongoid.org/en/origin/index.html
MIT License
62 stars 29 forks source link

Complex values in arrays aren't expanding #77

Closed timershaziganshin closed 11 years ago

timershaziganshin commented 11 years ago

Example:

class TestCriteria
  include Origin::Queryable
end

test_criteria = TestCriteria.new
test_criteria.where('$and' => [{:test2.in => ["val"]}])

produces selector

{
  "$and"=> [
    {
      "#<Origin::Key:0x007fe77a125520>"=>["val"]
    }
  ]
}

instead of

{
  "$and"=> [
    {
      "test2"=> {
        "$in"=> ["val"]
      }
    }
  ]
}