Skip to content

Instantly share code, notes, and snippets.

@mayo
Created February 8, 2009 19:40
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 mayo/60474 to your computer and use it in GitHub Desktop.
Save mayo/60474 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'dm-core'
require 'dm-serializer'
class Test
include DataMapper::Resource
property :id, Serial
end
DataMapper.setup(:default, "sqlite3:memory:")
Test.auto_migrate!
t = Test.create(:id => 1)
t.to_json # => "\"#<Test:0x17716e4>\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment