summaryrefslogtreecommitdiff
path: root/lib/scoring/marginal_peer.rb
blob: 8559b3d6720ecb941b6947f218466ec209cae0fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module Scoring
	module MarginalPeer
		def self.stats_needed
			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