From b35fa4b6f79d13d46eab4c9ba9e631eeb20ba73b Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Sun, 27 Apr 2014 23:15:31 -0400 Subject: replaced getStatistic with focused where --- app/models/match.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'app/models/match.rb') diff --git a/app/models/match.rb b/app/models/match.rb index 9045d67..e817b71 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -6,7 +6,14 @@ class Match < ActiveRecord::Base belongs_to :winner, class_name: "Team" def setup() - + end + + def finished? + ok = true + tournament_stage.scoring_method.stats_needed.each do |stat| + ok &= statistics.where(match: self, name: stat).nil? + end + ok end def is_match_over(match, firstPlayer) -- cgit v1.2.3-2-g168b From 919ba959bbc782315b0a8b171aa96e2118a43067 Mon Sep 17 00:00:00 2001 From: tkimia Date: Mon, 28 Apr 2014 00:00:47 -0400 Subject: fixed the db seeds. They can now be started --- app/models/match.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/models/match.rb') diff --git a/app/models/match.rb b/app/models/match.rb index d4c0ce5..ff81d68 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -12,6 +12,7 @@ class Match < ActiveRecord::Base ok = true tournament_stage.scoring_method.stats_needed.each do |stat| ok &= statistics.where(match: self, name: stat).nil? + end ok end -- cgit v1.2.3-2-g168b