1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-05-08 15:03:50 +00:00

Re-generating one weight classes matches - NEED TO REFACTOR and NEED TO WRITE TESTS

Code is repeated in the following classes:
GenerateTournamentMatches
PoolToBracketMatchGeneration
PoolToBracketGenerateLoserNames
WipeTournamentMatches
This commit is contained in:
2016-09-09 17:51:00 +00:00
parent a14d750f13
commit bbb745564e
9 changed files with 58 additions and 5 deletions

View File

@@ -3,7 +3,13 @@ class PoolToBracketMatchGeneration
@tournament = tournament
end
def generatePoolToBracketMatchesWeight(weight)
PoolGeneration.new(weight).generatePools()
last_match = @tournament.matches.where(weight: weight).order(round: :desc).limit(1).first
highest_round = last_match.round
PoolBracketGeneration.new(weight, highest_round).generateBracketMatches()
setOriginalSeedsToWrestleLastPoolRound(weight)
end
def generatePoolToBracketMatches
@tournament.weights.order(:max).each do |weight|