Created
October 5, 2008 05:53
-
-
Save nakajima/14852 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%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