Skip to content

Instantly share code, notes, and snippets.

@bernerdschaefer
Created July 23, 2010 19:20
Show Gist options
  • Select an option

  • Save bernerdschaefer/487907 to your computer and use it in GitHub Desktop.

Select an option

Save bernerdschaefer/487907 to your computer and use it in GitHub Desktop.
require 'mongoid'
require 'rspec'
Mongoid.configure do |config|
config.master = Mongo::Connection.new.db('testing')
end
class Person
include Mongoid::Document # ... fields ...
field :name
collection.remove
end
Person.create
p = Person.first
p.update_attributes(:name => "John").should == true
Person.first.name.should == "John"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment