Skip to content

Instantly share code, notes, and snippets.

@razielgn
Created August 17, 2011 13:29
Show Gist options
  • Save razielgn/1151526 to your computer and use it in GitHub Desktop.
Save razielgn/1151526 to your computer and use it in GitHub Desktop.
require 'mongoid'
require './lib/arnold'
class Test
include Mongoid::Document
field :name
field :job
field :rank
end
test = Test.new name: 'Arnold', job: 'Boss', rank: 1
test.edit # just :wq
=> #<Test _id: , _type: nil, name: "Arnold", job: "Boss", rank: 1>
# _id gets erased!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment