Re-namespacing a bit to clear out some fairly old stuff from the top level
This commit is contained in:
16
oldstuff/map-mash/app/models/mash_tournament_round.rb
Normal file
16
oldstuff/map-mash/app/models/mash_tournament_round.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class MashTournamentRound < ActiveRecord::Base
|
||||
belongs_to :tournament, :class_name => 'MashTournament'
|
||||
has_many :mashes
|
||||
|
||||
def self.for_round(tournament, round_number)
|
||||
self.find_by_mash_tournament_id_and_number(tournament, round_number)
|
||||
end
|
||||
|
||||
def done?
|
||||
winners = []
|
||||
self.mashes.collect do |mash|
|
||||
winners << mash.winner_id
|
||||
end
|
||||
!winners.include?(nil)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user