Class: ScavengerHunt::Player
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ScavengerHunt::Player
- Defined in:
- lib/scavenger_hunt/app/models/scavenger_hunt/player.rb
Instance Method Summary collapse
Methods inherited from ApplicationRecord
Instance Method Details
#aggregate_time ⇒ Object
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_count ⇒ Object
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_count ⇒ Object
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 |