class Score

Tie a Competition Result to its source Result from a SingleDayEvent, and holds the points earned for the Competition

Example: John Walrod places 3rd in the Mudslinger Singlespeed race. This earns him points for both the Singlespeed BAR and the Ironman:

Singlespeed BAR Score

Ironman Score

Public Instance Methods

<=>(other) click to toggle source

Compare by points

# File app/models/competitions/score.rb, line 35
def <=>(other)
  other.points <=> points
end
discipline() click to toggle source
# File app/models/competitions/score.rb, line 22
def discipline
  competition_result.race.discipline
end
source_discipline() click to toggle source
# File app/models/competitions/score.rb, line 26
def source_discipline
  source_result.try(:race).try(:discipline)
end
source_event_date() click to toggle source
# File app/models/competitions/score.rb, line 30
def source_event_date
  date || source_result.event.date
end
to_s() click to toggle source
# File app/models/competitions/score.rb, line 39
def to_s
  "#<Score #{id} #{source_result_id} #{competition_result_id} #{points}>"
end