1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-06 14:36:59 +00:00

Fixed mat assignment when matches are finished

This commit is contained in:
2016-01-11 16:48:08 +00:00
parent a2c0a2763e
commit cce30bdf3a
3 changed files with 5 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ class Mat < ActiveRecord::Base
end
def assignNextMatch
t_matches = tournament.matches.select{|m| m.mat_id == nil}
t_matches = tournament.matches.select{|m| m.mat_id == nil && m.finished != 1}
if t_matches.size > 0
match = t_matches.sort_by{|m| m.bout_number}.first
match.mat_id = self.id