diff options
author | Luke Shumaker <shumakl@purdue.edu> | 2014-04-29 08:30:55 -0400 |
---|---|---|
committer | Luke Shumaker <shumakl@purdue.edu> | 2014-04-29 08:30:55 -0400 |
commit | f461002bef30b7bc1751917ab388be8d4eab37d8 (patch) | |
tree | 740fc3d0cdaa11102be221f4fca9bd32f3ab9484 /lib/scoring/marginal_peer.rb | |
parent | 284da4d7e5badc0a1ad9dafc52672ab14168c91b (diff) |
fix scoring (mostly... I managed to get a 500 while refreshing)
Diffstat (limited to 'lib/scoring/marginal_peer.rb')
-rw-r--r-- | lib/scoring/marginal_peer.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/scoring/marginal_peer.rb b/lib/scoring/marginal_peer.rb index aa05f5e..8559b3d 100644 --- a/lib/scoring/marginal_peer.rb +++ b/lib/scoring/marginal_peer.rb @@ -1,13 +1,14 @@ module Scoring module MarginalPeer def self.stats_needed - return [:rating] + return ["rating", "win"] end - def self.score(match, interface) + def self.score(match) scores = {} - match.players.each do |player| - scores[player.user_name] = interface.get_statistic(match, player, :rating) + match.users.each do |user| + stats = Statistic.where(user: user, match: match) + scores[user] = stats.where(name: "rating").first.value end scores end |