Created
November 29, 2010 00:02
-
-
Save pikajude/719416 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
DataMapper.setup(:default, "sqlite3:users.db") | |
class Post | |
include DataMapper::Resource | |
has n, :voters | |
property :id, Serial | |
property :user, String, :required => true | |
property :line, Text, :required => true | |
property :created_at, DateTime | |
property :votes, Integer, :default => 0 | |
property :score, Integer, :default => 0 | |
property :ip, String | |
end | |
class Voter | |
include DataMapper::Resource | |
belongs_to :post | |
property :id, Serial | |
property :ip, String | |
property :positive, Boolean | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment