1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-07 06:54:16 +00:00

Fixed query for upcoming matches on the bout board and trying to fix why currently generating matches is not nil when

generating a single weight class.
This commit is contained in:
2018-02-01 07:45:08 -05:00
2 changed files with 21 additions and 21 deletions

View File

@@ -182,7 +182,7 @@ class TournamentsController < ApplicationController
def up_matches def up_matches
@matches = @tournament.matches.where(mat_id: nil).order('bout_number ASC').limit(10).includes(:wrestlers) @matches = @tournament.matches.where("mat_id is NULL and (finished <> ? or finished is NULL)",1).order('bout_number ASC').limit(10).includes(:wrestlers)
@mats = @tournament.mats.includes(:matches) @mats = @tournament.mats.includes(:matches)
end end

View File

@@ -39,7 +39,7 @@ class GenerateTournamentMatches
assignBouts assignBouts
assignFirstMatchesToMats assignFirstMatchesToMats
@tournament.curently_generating_matches = nil @tournament.curently_generating_matches = nil
@tournament.save @tournament.save!
end end
def assignBouts def assignBouts