Skip to content

Instantly share code, notes, and snippets.

@ku1ik
Created April 14, 2010 16:52
Show Gist options
  • Save ku1ik/366045 to your computer and use it in GitHub Desktop.
Save ku1ik/366045 to your computer and use it in GitHub Desktop.
Loading development environment (Rails 3.0.0.beta3)
ruby-1.8.7-p249 > class ::Heffalump
ruby-1.8.7-p249 ?> include DataMapper::Mongo::Resource
ruby-1.8.7-p249 ?> def self.default_repository_name; :logs; end
ruby-1.8.7-p249 ?> property :id, ObjectID
ruby-1.8.7-p249 ?> property :color, String
ruby-1.8.7-p249 ?> property :num_spots, Integer
ruby-1.8.7-p249 ?> property :striped, Boolean
ruby-1.8.7-p249 ?> end
=> #<DataMapper::Property @model=Heffalump @name=:striped>
ruby-1.8.7-p249 > h = Heffalump.create(:color => 'red')
=> #<Heffalump @id=nil @color="red" @num_spots=nil @striped=nil>
ruby-1.8.7-p249 > h.num_spots = 3
=> 3
ruby-1.8.7-p249 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment