Skip to content

Instantly share code, notes, and snippets.

@nakajima
Created October 5, 2008 05:53
Show Gist options
  • Save nakajima/14852 to your computer and use it in GitHub Desktop.
Save nakajima/14852 to your computer and use it in GitHub Desktop.
%w(rubygems sinatra sinatras-hat dm-core dm-serializer).each { |lib| require lib }
class Post
include DataMapper::Resource, DataMapper::Serialize
property :id, Serial, :key => true
property :name, String
property :body, Text
end
configure do
DataMapper.setup(:default, 'sqlite3::memory:')
Post.auto_migrate!
Post.create :name => 'A test', :body => "Some sort of thing"
Post.create :name => 'Another test', :body => "This is some other sort of thing"
end
mount Post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment