1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-05 22:21:26 +00:00

Error page for generating matches, cannot have more than 16 for Pool to bracket tournaments

This commit is contained in:
2016-01-20 15:15:39 +00:00
parent 1401dbea98
commit 40ebe64176
4 changed files with 40 additions and 2 deletions

View File

@@ -109,4 +109,26 @@ class Tournament < ActiveRecord::Base
end
end
end
def poolToBracketWeightsWithTooManyWrestlers
if self.tournament_type == "Pool to bracket"
weights.select{|w| w.wrestlers.size > 16}
else
nil
end
end
def tournamentMatchGenerationError
errorString = "There is a tournament error."
if poolToBracketWeightsWithTooManyWrestlers != nil
errorString = errorString + " The following weights have too many wrestlers "
poolToBracketWeightsWithTooManyWrestlers.each do |w|
errorString = errorString + "#{w.max} "
end
return errorString
else
nil
end
end
end