From 6adcc709e790b06647e0f2641b85077a20661e81 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Tue, 7 Jan 2025 08:18:45 -0500 Subject: [PATCH] Do not show matches with a BYE on the upcoming matches on the bout board. Those matches are filtered out on the next available match logic for the mats. --- app/controllers/tournaments_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index 6332e53..f32f7a7 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -191,7 +191,11 @@ class TournamentsController < ApplicationController def up_matches - @matches = @tournament.matches.where("mat_id is NULL and (finished <> ? or finished is NULL)",1).order('bout_number ASC').limit(10).includes(:wrestlers) + @matches = @tournament.matches + .where("mat_id is NULL and (finished <> ? or finished is NULL)",1) + .where.not(loser1_name: "BYE").where.not(loser2_name: "BYE") + .order('bout_number ASC') + .limit(10).includes(:wrestlers) @mats = @tournament.mats.includes(:matches) end