Created
July 31, 2011 13:28
-
-
Save durango/1116798 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class Mailbox | |
include DataMapper::Resource | |
property :id, Serial | |
property :title, String, :required => true, :length => 1..30 | |
property :message, Text, :required => true, :length => 1..3000 | |
property :date_sent, DateTime, :default => proc { DateTime.now } | |
belongs_to :to, 'Player' | |
belongs_to :from, 'Player' | |
end | |
class Player | |
[snip] | |
has n, :inbox, 'Mailbox', :child_key => :to_id | |
has n, :outbox, 'Mailbox', :child_key => :from_id | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment