RailsCasts Pro episodes are now free!

Learn more or hide this

warbot's Profile

GitHub User: ted-softserve

Comments by warbot

Avatar
ruby
class Author
  ...
  key :name # was removed in Mongoid3
end

You're supposed to override the _id field:

ruby
class Author
  ...
  field :_id, type: String, default: ->{ name }
end

Docs: http://mongoid.org/en/mongoid/docs/upgrading.html