1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-12 16:25:41 +00:00

Speeding up tests and renaming a few methods in generateMatchups

This commit is contained in:
2016-03-26 03:54:31 +00:00
parent f66725d750
commit ddcf2d807e
17 changed files with 2814 additions and 729 deletions

View File

@@ -8,7 +8,6 @@ module GeneratesTournamentMatches
poolToBracket() if tournament_type == "Pool to bracket"
self.curently_generating_matches = nil
self.save
matches
end
if Rails.env.production?
handle_asynchronously :generateMatchups
@@ -16,13 +15,11 @@ module GeneratesTournamentMatches
def poolToBracket
destroyAllMatches
buildTournamentWeights
generateMatches
# This is not working for pool order and I cannot get tests working
movePoolSeedsToFinalPoolRound
generatePoolToBracketMatches
poolToBracketPostMatchCreation
end
def buildTournamentWeights
def generatePoolToBracketMatches
weights.order(:max).each do |weight|
Pool.new(weight).generatePools()
last_match = matches.where(weight: weight).order(round: :desc).limit(1).first
@@ -31,11 +28,12 @@ module GeneratesTournamentMatches
end
end
def generateMatches
def poolToBracketPostMatchCreation
moveFinalsMatchesToLastRound
assignBouts
assignLoserNames
assignFirstMatchesToMats
movePoolSeedsToFinalPoolRound
end
def moveFinalsMatchesToLastRound