Created
April 14, 2010 23:06
-
-
Save solnic/366452 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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