Created
May 20, 2009 17:26
-
-
Save anonymous/114960 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 GameMode | |
include DataMapper::Resource | |
property :id, Serial | |
property :title, String | |
property :description, Text | |
property :max_players, Integer | |
has n, :game_mode_types | |
has n, :game_mode_matches | |
has n, :parents, :through => :game_mode_matches, :class_name => 'GameMode', | |
:remote_name => :parent, :child_key => [:parent_id] | |
has n, :children, :through => :game_mode_matches, :class_name => 'GameMode', | |
:remote_name => :child, :child_key => [:child_id] | |
belongs_to :game | |
end | |
class GameModeMatch | |
include DataMapper::Resource | |
property :parent_id, Integer, :key => true | |
property :child_id, Integer, :key => true | |
belongs_to :parent, :class_name => 'GameMode', :child_key => [:parent_id] | |
belongs_to :child, :class_name => 'GameMode', :child_key => [:child_id] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment