diff options
Diffstat (limited to 'lib/scoring/marginal_peer.rb')
-rw-r--r-- | lib/scoring/marginal_peer.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/scoring/marginal_peer.rb b/lib/scoring/marginal_peer.rb new file mode 100644 index 0000000..f2c0272 --- /dev/null +++ b/lib/scoring/marginal_peer.rb @@ -0,0 +1,16 @@ +module Scoring + module MarginalPeer + def self.stats_needed(match) + return ["rating", "win"] + end + + def self.score(match) + scores = {} + match.users.each do |user| + stats = Statistic.where(user: user, match: match) + scores[user] = stats.where(name: "rating").first.value + end + scores + end + end +end |