diff --git a/app/models/generates_tournament_matches.rb b/app/models/generates_tournament_matches.rb index 873bc27..a9b37f5 100644 --- a/app/models/generates_tournament_matches.rb +++ b/app/models/generates_tournament_matches.rb @@ -3,6 +3,7 @@ module GeneratesTournamentMatches def generateMatchups self.curently_generating_matches = 1 self.save + removeSchoolDelegations resetSchoolScores setSeedsAndRandomSeedingWrestlersWithoutSeeds poolToBracket() if tournament_type == "Pool to bracket" @@ -50,5 +51,13 @@ module GeneratesTournamentMatches w.setSeeds end end + + def removeSchoolDelegations + self.schools.each do |s| + s.delegates.each do |d| + d.destroy + end + end + end end diff --git a/app/views/tournaments/generate_matches.html.erb b/app/views/tournaments/generate_matches.html.erb index ba0cac2..c8166f5 100644 --- a/app/views/tournaments/generate_matches.html.erb +++ b/app/views/tournaments/generate_matches.html.erb @@ -1,3 +1,3 @@ <%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>

-Matches are being generated. This can take anywhere from 1-5 minutes to finish. \ No newline at end of file +Matches are being generated. This can take anywhere from 1-5 minutes to finish. All permission delegations for schools have been deleted to prevent lineup changes after the tournament has started. \ No newline at end of file