1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-09 15:42:09 +00:00

Show no matches while matches are being generated

This commit is contained in:
2015-12-30 16:36:53 +00:00
parent 74577eb9ec
commit 6d21e8ebdf
4 changed files with 12 additions and 2 deletions

View File

@@ -144,7 +144,7 @@ class TournamentsController < ApplicationController
def check_for_matches
if @tournament
if @tournament.matches.empty?
if @tournament.matches.empty? or @tournament.curently_generating_matches == 1
redirect_to "/tournaments/#{@tournament.id}/no_matches"
end
end

View File

@@ -1,9 +1,13 @@
module GeneratesTournamentMatches
def generateMatchups
self.curently_generating_matches = 1
self.save
resetSchoolScores
setSeedsAndRandomSeedingWrestlersWithoutSeeds
poolToBracket() if tournament_type == "Pool to bracket"
self.curently_generating_matches = nil
self.save
matches
end
if Rails.env.production?