Class: ScavengerHunt::Hint
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ScavengerHunt::Hint
- Defined in:
- lib/scavenger_hunt/app/models/scavenger_hunt/hint.rb
Constant Summary collapse
- PENALTY =
30.seconds
Instance Method Summary collapse
Methods inherited from ApplicationRecord
Instance Method Details
#next_hint ⇒ Object
17 18 19 20 |
# File 'lib/scavenger_hunt/app/models/scavenger_hunt/hint.rb', line 17 def next_hint return @next_hint if defined? @next_hint @next_hint = clue.hints.where("position > ?", position).first end |
#previous_hint ⇒ Object
22 23 24 25 |
# File 'lib/scavenger_hunt/app/models/scavenger_hunt/hint.rb', line 22 def previous_hint return @previous_hint if defined? @previous_hint @previous_hint = clue.hints.where("position < ?", position).order(position: :desc).first end |