mongoid / origin

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

Selector values being evolved in-place #56

Closed bensymonds closed 11 years ago

bensymonds commented 11 years ago

E.g:

class Foo
  include Mongoid::Document
  ALLOWED_VALUES = %w(a b).freeze
  field :f
end

> Foo.where(:f.in => Foo::ALLOWED_VALUES).count
RuntimeError: can't modify frozen Array
    from /Users/ben/.rvm/gems/ruby-1.9.3-p125@eqm/gems/origin-1.0.10/lib/origin/selector.rb:115:in `map!'
...

Seems wrong to be mutating the value passed in...