mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-14 08:58:29 +00:00
Remove school delegations when generating matches
This commit is contained in:
@@ -3,6 +3,7 @@ module GeneratesTournamentMatches
|
|||||||
def generateMatchups
|
def generateMatchups
|
||||||
self.curently_generating_matches = 1
|
self.curently_generating_matches = 1
|
||||||
self.save
|
self.save
|
||||||
|
removeSchoolDelegations
|
||||||
resetSchoolScores
|
resetSchoolScores
|
||||||
setSeedsAndRandomSeedingWrestlersWithoutSeeds
|
setSeedsAndRandomSeedingWrestlersWithoutSeeds
|
||||||
poolToBracket() if tournament_type == "Pool to bracket"
|
poolToBracket() if tournament_type == "Pool to bracket"
|
||||||
@@ -50,5 +51,13 @@ module GeneratesTournamentMatches
|
|||||||
w.setSeeds
|
w.setSeeds
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def removeSchoolDelegations
|
||||||
|
self.schools.each do |s|
|
||||||
|
s.delegates.each do |d|
|
||||||
|
d.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>
|
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>
|
||||||
<br><br>
|
<br><br>
|
||||||
Matches are being generated. This can take anywhere from 1-5 minutes to finish.
|
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.
|
||||||
Reference in New Issue
Block a user