Skip to content

Instantly share code, notes, and snippets.

@myabc
Created January 4, 2010 11:57
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 myabc/268480 to your computer and use it in GitHub Desktop.
Save myabc/268480 to your computer and use it in GitHub Desktop.
$LOAD_PATH << 'data_objects/lib'
$LOAD_PATH << 'do_sqlite3/lib'
require "rubygems"
require "dm-core"
#require "dm-validations"
require "spec"
DataMapper::Logger.new(STDOUT, :debug)
DataMapper.setup(:default, 'sqlite3:database')
class Author
include DataMapper::Resource
property :id, Serial
property :name, String
# validates_present :name
end
DataMapper.auto_migrate!
p = Author.new(:name => "Günter Grass")
p.save
puts Author.first.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment