Skip to content

Instantly share code, notes, and snippets.

@bernerdschaefer
Created July 22, 2010 20:34
Show Gist options
  • Save bernerdschaefer/486554 to your computer and use it in GitHub Desktop.
Save bernerdschaefer/486554 to your computer and use it in GitHub Desktop.
require 'mongoid'
Mongoid.configure do |config|
config.master = Mongo::Connection.new.db('testing')
end
class Publisher
include Mongoid::Document
field :stuff, :type => Hash
collection.remove
end
publisher = Publisher.create :stuff => { :hello => "world" }
publisher.stuff[:hello] = "hola!"
publisher.save
p Publisher.first.stuff
__END__
> bundle exec ruby issue-155.rb
{"hello"=>"hola!"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment