From 7d092c3d3593a18ff83111e92ec54c1adaf0d6e8 Mon Sep 17 00:00:00 2001 From: jcwimer Date: Wed, 6 Jan 2016 02:52:24 +0000 Subject: [PATCH] Fixed assigning mats bug --- app/models/tournament.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/tournament.rb b/app/models/tournament.rb index 60e48b4..82ce8db 100644 --- a/app/models/tournament.rb +++ b/app/models/tournament.rb @@ -69,7 +69,7 @@ class Tournament < ActiveRecord::Base def assignMats(matsToAssign) if matsToAssign.count > 0 - until matsToAssign.sort_by{|m| m.id}.last.matches.count == 4 + until matsToAssign.sort_by{|m| m.id}.last.unfinishedMatches.count == 4 matsToAssign.sort_by{|m| m.id}.each do |m| m.assignNextMatch end