BenMusch/nu-tab

View on GitHub
app/policies/stats/round/iron_person_policy.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true
Add an empty line after magic comments.
module Stats
module Round
class IronPersonPolicy < StandardPolicy
def speaks
stats.pluck(:speaks).reduce(:+) / 2.0
end
 
def ranks
stats.pluck(:ranks).reduce(:+) / 2.0
end
 
private
 
def stats
@stats ||= debater.debater_round_stats.where(round: round)
end
end
end
end