diff options
Diffstat (limited to 'app/models/hearth_amenity.rb')
-rw-r--r-- | app/models/hearth_amenity.rb | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/app/models/hearth_amenity.rb b/app/models/hearth_amenity.rb index 16d8f97..f8ebad5 100644 --- a/app/models/hearth_amenity.rb +++ b/app/models/hearth_amenity.rb @@ -1,14 +1,9 @@ class HearthAmenity < ApplicationRecord include HasWhatnot - validates :gid, :name, :description, :whatnot, presence: true + validates :gid, :name, :description, presence: true - def build_requirements_string(level) - requirements = [] - data = self.whatnot[:constructions].find { |d| d[:level] == level } - data[:cost][:items].each do |item_gid, quantity| - requirements.push "#{quantity} #{Item.find_by_gid(item_gid).name}" - end - requirements.join(", ") + def construct_activity(level) + Activity.find_by_gid("construct_#{self.name.underscore}_level#{level}") end end |