-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
This shouldn't happen:
class Address include Mongoid::Document field :name field :tags, :type => Array end Address.where :tags => nil NoMethodError: undefined method `new' for NilClass:Class from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/mongoid-2.1.7/lib/mongoid/serialization.rb:53:in `mongoize' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/mongoid-2.1.7/lib/mongoid/criterion/selector.rb:116:in `typecast_value_for' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/mongoid-2.1.7/lib/mongoid/criterion/selector.rb:88:in `try_to_typecast' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/mongoid-2.1.7/lib/mongoid/criterion/selector.rb:33:in `[]=' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/mongoid-2.1.7/lib/mongoid/criterion/inclusion.rb:170:in `block (2 levels) in where' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/mongoid-2.1.7/lib/mongoid/criterion/inclusion.rb:161:in `each_pair' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/mongoid-2.1.7/lib/mongoid/criterion/inclusion.rb:161:in `block in where' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/mongoid-2.1.7/lib/mongoid/criterion/inclusion.rb:154:in `tap' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/mongoid-2.1.7/lib/mongoid/criterion/inclusion.rb:154:in `where' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/mongoid-2.1.7/lib/mongoid/finders.rb:14:in `where' from (irb):16 from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.4/lib/rails/commands/console.rb:44:in `start' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.4/lib/rails/commands/console.rb:8:in `start' from /usr/local/rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.4/lib/rails/commands.rb:23:in `<top (required)>' from script/rails:6:in `require' from script/rails:6:in `<main>'