summaryrefslogtreecommitdiff
path: root/app/models/match.rb
diff options
context:
space:
mode:
authortkimia <tkimia@purdue.edu>2014-04-28 22:01:14 -0400
committertkimia <tkimia@purdue.edu>2014-04-28 22:01:14 -0400
commitdd4c9e16c529bdbf0d055b279ed2dadc0c2aae13 (patch)
treeb0c9377df1f11ae626e5bd7057de158301884e0d /app/models/match.rb
parentbc8be5e217279012cd4dc62e3fc2fe2bd9308b1c (diff)
parentd52ceaf8d2b823b68edcf3614999b8639a0971f9 (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'app/models/match.rb')
-rw-r--r--app/models/match.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/models/match.rb b/app/models/match.rb
index 219e662..85084f5 100644
--- a/app/models/match.rb
+++ b/app/models/match.rb
@@ -7,8 +7,8 @@ class Match < ActiveRecord::Base
def finished?
ok = true
- tournament_stage.scoring_method.stats_needed.each do |stat|
- ok &= statistics.where(match: self, name: stat).nil?
+ tournament_stage.scoring.stats_needed.each do |stat|
+ ok &= !statistics.where(match: self, name: stat).nil?
end
ok
end
@@ -46,6 +46,12 @@ class Match < ActiveRecord::Base
return html.html_safe
end
+ def start_sampling
+ method_classes.each do |klass|
+ klass.new(self).start
+ end
+ end
+
private
def figure_sampling_methods
if @sampling_methods.nil?