Skip to content

Instantly share code, notes, and snippets.

@mkristian
Created December 2, 2009 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkristian/247052 to your computer and use it in GitHub Desktop.
Save mkristian/247052 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'dm-core'
require 'dm-validations'
class Role
include DataMapper::Resource
property :id, Serial
property :name, String, :allow_nil => false
end
DataMapper.setup(:default, "sqlite3::memory:")
Role.auto_migrate!
r = Role.new()
p r.valid?
p r
p r.errors
p r.save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment