From 5264947608c81176320981e9bccd9b02f2089db6 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Sun, 3 Nov 2024 12:24:54 -0800 Subject: [PATCH] Minor tweaks to modeling private methods --- app/models/pet/modeling_snapshot.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/models/pet/modeling_snapshot.rb b/app/models/pet/modeling_snapshot.rb index 89e5f433..52944111 100644 --- a/app/models/pet/modeling_snapshot.rb +++ b/app/models/pet/modeling_snapshot.rb @@ -63,12 +63,10 @@ class Pet::ModelingSnapshot end def items - @items ||= begin - @object_info_registry.map do |id, item_data| - Item.find_or_initialize_by(id:).tap do |item| - item.add_origin_registry_info item_data - item.swf_assets = item_assets_for id - end + @items ||= @object_info_registry.map do |id, item_data| + Item.find_or_initialize_by(id:).tap do |item| + item.add_origin_registry_info item_data + item.swf_assets = item_assets_for id end end end @@ -98,7 +96,7 @@ class Pet::ModelingSnapshot def alt_style_assets raise Pet::UnexpectedDataFormat if @custom_pet[:biology_by_zone].empty? - assets_from_biology(@custom_pet[:biology_by_zone]) + @alt_style_assets ||= assets_from_biology(@custom_pet[:biology_by_zone]) end def assets_from_biology(biology)