1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

When generating a new weight, wipe mats from matches

This commit is contained in:
2018-01-31 08:49:38 -05:00
parent 9841f5648d
commit 275e65c7a1

View File

@@ -8,6 +8,7 @@ class GenerateTournamentMatches
@tournament.curently_generating_matches = 1 @tournament.curently_generating_matches = 1
@tournament.save @tournament.save
unAssignBouts unAssignBouts
unAssignMats
PoolToBracketMatchGeneration.new(@tournament).generatePoolToBracketMatchesWeight(weight) if @tournament.tournament_type == "Pool to bracket" PoolToBracketMatchGeneration.new(@tournament).generatePoolToBracketMatchesWeight(weight) if @tournament.tournament_type == "Pool to bracket"
postMatchCreationActions postMatchCreationActions
PoolToBracketGenerateLoserNames.new(@tournament).assignLoserNamesWeight(weight) if @tournament.tournament_type == "Pool to bracket" PoolToBracketGenerateLoserNames.new(@tournament).assignLoserNamesWeight(weight) if @tournament.tournament_type == "Pool to bracket"
@@ -71,6 +72,13 @@ class GenerateTournamentMatches
end end
end end
def unAssignMats
matches = @tournament.matches.reload
matches.each do |m|
m.mat_id = nil
end
end
def unAssignBouts def unAssignBouts
bout_counts = Hash.new(0) bout_counts = Hash.new(0)
@tournament.matches.each do |m| @tournament.matches.each do |m|