-
-
Save TheNicholasNick/146870 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
module War | |
class War::Character | |
include DataMapper::Resource | |
property :id, Serial | |
has n, :raid_participations, :class_name => 'War::RaidParticipants' | |
has n, :raids, :class_name => 'War::Raid', :through => :raid_participations, :child_key => [:character_id] | |
end | |
class Raid | |
include DataMapper::Resource | |
property :id, Serial | |
has n, :raid_participants, :class_name => 'War::RaidParticipants' | |
end | |
class RaidParticipants | |
include DataMapper::Resource | |
property :raid_id, Integer, :key => true | |
property :character_id, Integer, :key => true | |
belongs_to :raid, :class_name => 'War::Raid', :child_key => [:raid_id] | |
belongs_to :character, :class_name => 'War::Character', :child_key => [:character_id] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment