1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Fixed the query for unassigned matches on the up_matches page and also only allow mats to get a new match assigned if they have less than 4 unfinished matches. Added mats to the finish_tournament_204 rake task.

This commit is contained in:
2025-01-10 16:02:37 -05:00
parent 38785924ed
commit e612a4b10e
3 changed files with 29 additions and 4 deletions

View File

@@ -23,7 +23,8 @@ class Mat < ApplicationRecord
def assign_next_match
match = next_eligible_match
if match
self.matches.reload
if match and self.unfinished_matches.size < 4
match.mat_id = self.id
if match.save
# Invalidate any wrestler caches