DataMapper.setup(:default, "sqlite3://#{Dir.pwd}/mydatabase.sqlite3")
class Topic
include DataMapper::Resource
property :id, Serial
property :title, String
property :body, Text
property :added, DateTime
belongs_to :author, :class_name => 'User', :child_key => [:author_id]
end
class User
include DataMapper::Resource
property :id, Serial
property :login, String
has n, :topics
end
DataMapper.auto_migrate!