blob: a5dde235d9e5c82cd7a1f6a8580be8d7355b6b13 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
class HearthAmenity < ApplicationRecord
include HasWhatnot
validates :gid, :name, :description, presence: true
def construct_activity(level)
activity_data = self.whatnot[:construct_activities].find { |a| a[:level] == level }
return nil unless activity_data
Activity.find_by_gid(activity_data[:gid])
end
end
|