Class: ScavengerHunt::Player

Inherits:
ApplicationRecord show all
Defined in:
lib/scavenger_hunt/app/models/scavenger_hunt/player.rb

Instance Method Summary collapse

Methods inherited from ApplicationRecord

hook, position_scope

Instance Method Details

#aggregate_timeObject



23
24
25
# File 'lib/scavenger_hunt/app/models/scavenger_hunt/player.rb', line 23

def aggregate_time
  games.unarchived.sum(&:total_time)
end

#clue_countObject



27
28
29
# File 'lib/scavenger_hunt/app/models/scavenger_hunt/player.rb', line 27

def clue_count
  "#{clues.answered.count}/#{clues.count}"
end

#location_countObject



31
32
33
# File 'lib/scavenger_hunt/app/models/scavenger_hunt/player.rb', line 31

def location_count
  "#{games.select('DISTINCT(location_id)').count}/#{ScavengerHunt::Location.count}"
end