Class: ScavengerHunt::Location

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

Instance Method Summary collapse

Methods inherited from ApplicationRecord

hook, position_scope

Instance Method Details

#played?(by) ⇒ Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/scavenger_hunt/app/models/scavenger_hunt/location.rb', line 47

def played?(by)
  by && games.ended.where(player_id: by.id).any?
end

#representations_by_metum(metum_name) ⇒ Object



51
52
53
# File 'lib/scavenger_hunt/app/models/scavenger_hunt/location.rb', line 51

def representations_by_metum(metum_name)
  representations.with_metum_named(metum_name)
end