summaryrefslogtreecommitdiff
path: root/app/models/match.rb
diff options
context:
space:
mode:
authortkimia <tkimia@purdue.edu>2014-04-29 16:41:35 -0400
committertkimia <tkimia@purdue.edu>2014-04-29 16:41:35 -0400
commit42d6e3b1cc05ef5172081682b53675e4827254d3 (patch)
tree240743892a6f0948774f1b89bf5bf58ed49f6416 /app/models/match.rb
parent0d6f7a3bfbf4c87510a1bcf967b618f98e149d49 (diff)
elimination works SOMETIMES... other times it just can't put down a damned winner
Diffstat (limited to 'app/models/match.rb')
-rw-r--r--app/models/match.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/models/match.rb b/app/models/match.rb
index 7b36777..65e2047 100644
--- a/app/models/match.rb
+++ b/app/models/match.rb
@@ -20,7 +20,9 @@ class Match < ActiveRecord::Base
def finished?
ok = true
tournament_stage.scoring.stats_needed.each do |stat|
- ok &= !statistics.where(match: self, name: stat).nil?
+ self.users.each do |user|
+ ok &= statistics.where(match: self, user: user, name: stat)
+ end
end
ok
end
@@ -46,6 +48,11 @@ class Match < ActiveRecord::Base
# Delagates PUT/PATCH HTTP params to the appropriate sampling
# methods.
def handle_sampling(user, params)
+ require 'pp'
+ puts('>'*80)
+ pp user
+ pp params
+ puts('<'*80)
method_classes.each do |klass|
klass.new(self).handle_user_interaction(user, params)
end