1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00
Files
wrestlingdev.com/app/services/tournament_services/wipe_tournament_matches.rb
jcwimer bbb745564e 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
2016-09-09 17:51:00 +00:00

23 lines
434 B
Ruby

class WipeTournamentMatches
def initialize( tournament )
@tournament = tournament
end
def setUpMatchGeneration
wipeMatches
resetSchoolScores
end
def wipeWeightMatches(weight)
weight.matches.destroy_all
end
def wipeMatches
@tournament.matches.destroy_all
end
def resetSchoolScores
@tournament.schools.update_all("score = 0.0")
end
end