rtopitt/bolao2014

View on GitHub
app/models/match_scorer.rb

Summary

Maintainability
A
0 mins
Test Coverage
class MatchScorer
  # include EventScorer # TODO?

  attr_reader :match

  def initialize(match)
    @match = match
  end

  # Score all existing match_bets for this match (calculates the points and saves on the match_bets).
  # Can be run any number of times.
  def score_all!
    match.match_bets.find_each do |match_bet|
      match_bet.score!
    end
  end

end