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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user