You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
377 B
20 lines
377 B
class MashTournament < ActiveRecord::Base
|
|
belongs_to :requester
|
|
has_many :mashes
|
|
has_many :rounds, :class_name => 'MashTournamentRound'
|
|
|
|
def next_unplayed_mash
|
|
self.mashes.unplayed.first
|
|
end
|
|
|
|
def done?
|
|
true
|
|
end
|
|
|
|
def round(number = 0)
|
|
MashTournamentRound.find_by_mash_tournament_id(self.id,
|
|
:conditions => {:number => number}
|
|
)
|
|
end
|
|
end
|