Sha256: 5b64dd7f7ce7bbdcbb09c3149a65fbfbbc8a497736e8142ae7b7e259962bef00

Contents?: true

Size: 247 Bytes

Versions: 1

Compression:

Stored size: 247 Bytes

Contents

module Competition
  class Score < ActiveRecord::Base
    attr_accessible :scoreable_id, :scoreable_type
    belongs_to :scoreable, :polymorphic => true
    has_many :score_entries

    def total
      score_entries.sum(:amount)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
Competition-0.0.2 app/models/competition/score.rb