diff --git a/app/models/item.rb b/app/models/item.rb index 064223b9..5523bd64 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -342,7 +342,8 @@ class Item < ActiveRecord::Base asset_registry.each do |asset_id, asset_data| swf_asset_ids << asset_id.to_i if asset_data end - existing_swf_assets = SwfAsset.object_assets.find_all_by_remote_id swf_asset_ids + existing_swf_assets = SwfAsset.object_assets.includes(:zone). + find_all_by_remote_id swf_asset_ids existing_swf_assets_by_remote_id = {} existing_swf_assets.each do |swf_asset| existing_swf_assets_by_remote_id[swf_asset.remote_id] = swf_asset diff --git a/app/models/pet_state.rb b/app/models/pet_state.rb index d112edc9..33b95d28 100644 --- a/app/models/pet_state.rb +++ b/app/models/pet_state.rb @@ -120,7 +120,8 @@ class PetState < ActiveRecord::Base swf_asset_ids_str ) end - existing_swf_assets = SwfAsset.biology_assets.find_all_by_remote_id(swf_asset_ids) + existing_swf_assets = SwfAsset.biology_assets.includes(:zone). + find_all_by_remote_id(swf_asset_ids) existing_swf_assets_by_id = {} existing_swf_assets.each do |swf_asset| existing_swf_assets_by_id[swf_asset.remote_id] = swf_asset