summaryrefslogtreecommitdiff
path: root/lib/scoring/fibonacci_peer_with_blowout.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scoring/fibonacci_peer_with_blowout.rb')
-rw-r--r--lib/scoring/fibonacci_peer_with_blowout.rb15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/scoring/fibonacci_peer_with_blowout.rb b/lib/scoring/fibonacci_peer_with_blowout.rb
index f592540..9d72643 100644
--- a/lib/scoring/fibonacci_peer_with_blowout.rb
+++ b/lib/scoring/fibonacci_peer_with_blowout.rb
@@ -1,19 +1,18 @@
module Scoring
module FibonacciPeerWithBlowout
def self.stats_needed
- return [:votes, :win, :blowout]
+ return ["votes", "win", "blowout"]
end
def self.score(match)
scores = {}
- match.players.each do |player|
- stats = Statistics.where(user: player, match: match)
+ match.users.each do |user|
+ stats = Statistic.where(user: user, match: match)
- votes = stats.where(name: :votes ).first
- win = stats.where(name: :win ).first
- blowout = stats.where(name: :blowout).first
-
- scores[player] = self.score_user(votes, win, blowout)
+ votes = stats.where(name: "votes" ).first.value
+ win = stats.where(name: "win" ).first.value
+ blowout = stats.where(name: "blowout").first.value
+ scores[user] = self.score_user(votes, win, blowout)
end
scores
end