diff options
Diffstat (limited to 'lib/scoring/winner_takes_all.rb')
-rw-r--r-- | lib/scoring/winner_takes_all.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/scoring/winner_takes_all.rb b/lib/scoring/winner_takes_all.rb index db494c6..6cffb28 100644 --- a/lib/scoring/winner_takes_all.rb +++ b/lib/scoring/winner_takes_all.rb @@ -8,14 +8,9 @@ module Scoring scores = {} match.users.each do |user| stats = Statistic.where(user: user, match: match) - scores[user] = score_user(stats.where(name: "win").first) + scores[user] = stats.where(name: "win").first.value ? 1 : 0 end scores end - - private - def self.score_user(win) - win.nil? ? 0.5 : win ? 1 : 0 - end end end |