diff options
author | AndrewMurrell <amurrel@purdue.edu> | 2014-04-27 23:15:31 -0400 |
---|---|---|
committer | AndrewMurrell <amurrel@purdue.edu> | 2014-04-27 23:15:31 -0400 |
commit | b35fa4b6f79d13d46eab4c9ba9e631eeb20ba73b (patch) | |
tree | fd0e0cc49139e009df042c66442993b814d0f9c4 /app/models | |
parent | d4e4e9281ac707130281eff3beb4bd100dd07809 (diff) |
replaced getStatistic with focused where
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/match.rb | 9 |
1 files changed, 8 insertions, 1 deletions
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) |