diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/hearth_amenity.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/hearth_amenity.rb b/app/models/hearth_amenity.rb index a5dde23..52ca85e 100644 --- a/app/models/hearth_amenity.rb +++ b/app/models/hearth_amenity.rb @@ -4,6 +4,7 @@ class HearthAmenity < ApplicationRecord validates :gid, :name, :description, presence: true def construct_activity(level) + return nil unless self.whatnot activity_data = self.whatnot[:construct_activities].find { |a| a[:level] == level } return nil unless activity_data Activity.find_by_gid(activity_data[:gid]) |