Upgrade Mongoid - Default Type for Field

28 Jan 2011

If you have watched the episode about mongoid from railscast, ryanb removed the default type String for field, like

class Article
  field :name, :type => String
  field :content, :type => String

can be written as

class Article
  field :name
  field :content

but it is not valid from mongoid.2.0.0.rc.1 again, the default type of field is changed from String to Object, that means we should explicitly set the type for each field.


blog comments powered by Disqus