mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-23 06:41:00 +00:00
Refactored match generation so I can eventually support multiple types of tournaments
This commit is contained in:
19
app/services/tournament_services/wipe_tournament_matches.rb
Normal file
19
app/services/tournament_services/wipe_tournament_matches.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class WipeTournamentMatches
|
||||
|
||||
def initialize( tournament )
|
||||
@tournament = tournament
|
||||
end
|
||||
|
||||
def setUpMatchGeneration
|
||||
wipeMatches
|
||||
resetSchoolScores
|
||||
end
|
||||
|
||||
def wipeMatches
|
||||
@tournament.matches.destroy_all
|
||||
end
|
||||
|
||||
def resetSchoolScores
|
||||
@tournament.schools.update_all("score = 0.0")
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user