From c537c6067c0dae18324040fc00f23197239c551f Mon Sep 17 00:00:00 2001 From: jcwimer Date: Wed, 13 Jan 2016 13:50:19 +0000 Subject: [PATCH] Recommend deleting delegations instead of deleting them --- app/models/generates_tournament_matches.rb | 9 +-------- app/models/tournament.rb | 8 ++++++++ app/views/tournaments/generate_matches.html.erb | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/models/generates_tournament_matches.rb b/app/models/generates_tournament_matches.rb index a9b37f5..b140878 100644 --- a/app/models/generates_tournament_matches.rb +++ b/app/models/generates_tournament_matches.rb @@ -3,7 +3,6 @@ module GeneratesTournamentMatches def generateMatchups self.curently_generating_matches = 1 self.save - removeSchoolDelegations resetSchoolScores setSeedsAndRandomSeedingWrestlersWithoutSeeds poolToBracket() if tournament_type == "Pool to bracket" @@ -52,12 +51,6 @@ module GeneratesTournamentMatches end end - def removeSchoolDelegations - self.schools.each do |s| - s.delegates.each do |d| - d.destroy - end - end - end + end diff --git a/app/models/tournament.rb b/app/models/tournament.rb index 3469424..983f442 100644 --- a/app/models/tournament.rb +++ b/app/models/tournament.rb @@ -101,4 +101,12 @@ class Tournament < ActiveRecord::Base end point_adjustments 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 c8166f5..b5187ac 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. All permission delegations for schools have been deleted to prevent lineup changes after the tournament has started. \ No newline at end of file +Matches are being generated. This can take anywhere from 1-5 minutes to finish. It is recommended to delete all delegated school permissions to prevent lineup changes after the tournament has started. \ No newline at end of file