summaryrefslogtreecommitdiff
path: root/lib/scoring/marginal_peer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scoring/marginal_peer.rb')
-rw-r--r--lib/scoring/marginal_peer.rb9
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