Skip to content

Instantly share code, notes, and snippets.

@mkristian
Created May 19, 2010 15:36
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/406443 to your computer and use it in GitHub Desktop.
Save mkristian/406443 to your computer and use it in GitHub Desktop.
require 'rubygems'
gem 'dm-core', '0.10.2'
gem 'do_sqlite3', '0.10.1.1'
require 'dm-core'
p DataMapper::VERSION
require 'do_sqlite3/version'
p DataObjects::Sqlite3::VERSION
DataMapper.setup(:default, "sqlite3:./test.sqlite3")
class T
include DataMapper::Resource
property :id, Serial
property :flag, Boolean
end
T.auto_migrate!
T.create(:flag => true)
t = T.first
p t
t.flag = false
t.save
p T.all
t.flag = true
t.save
p T.all
$ ruby do.rb
"0.10.2"
"0.10.1.1"
#<T @id=1 @flag=true>
[#<T @id=1 @flag=false>]
[#<T @id=1 @flag=true>]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment