diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/activity.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/activity.rb b/app/models/activity.rb index 562abf4..c557752 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -8,7 +8,7 @@ class Activity < ApplicationRecord def costs costs = [] - self.whatnot[:cost].each do |cost| + self.whatnot[:cost]&.each do |cost| case cost[:type] when "item" costs.push "#{cost[:quantity]} #{Item.find_by_gid(cost[:gid]).name}" @@ -19,7 +19,7 @@ class Activity < ApplicationRecord def requirements requirements = [] - self.whatnot[:requirements].each do |req| + self.whatnot[:requirements]&.each do |req| case req[:type] when "skill" requirements.push "level #{req[:level]} #{Skill.find_by_gid(req[:gid]).name}" |