Skip to content

Instantly share code, notes, and snippets.

@solnic
Created April 14, 2010 23:06
Show Gist options
  • Save solnic/366452 to your computer and use it in GitHub Desktop.
Save solnic/366452 to your computer and use it in GitHub Desktop.
require 'dm-core'
require 'dm-migrations'
require 'dm-types'
DataMapper.setup(:default, "mysql://localhost/dm_core_test")
class Heffalump
include DataMapper::Resource
property :id, UUID, :key => true, :default => lambda{UUIDTools::UUID.random_create}
property :color, String
property :num_spots, Integer
property :striped, Boolean
end
DataMapper.auto_migrate!
h = Heffalump.create(:color => 'red')
h.num_spots = 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment