From c2c0fe92e8c844c0ab51097e78997892985d04fd Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 12 Jan 2012 21:47:17 -0600 Subject: [PATCH] oops, be consistent in using remote ID when loading pets --- app/models/item.rb | 2 +- app/models/pet_state.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/item.rb b/app/models/item.rb index 68a072e3..8fa80883 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -286,7 +286,7 @@ class Item < ActiveRecord::Base existing_swf_assets = SwfAsset.object_assets.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.id] = swf_asset + existing_swf_assets_by_id[swf_asset.remote_id] = swf_asset end # With each asset in the registry, diff --git a/app/models/pet_state.rb b/app/models/pet_state.rb index 06c17f69..9eebc709 100644 --- a/app/models/pet_state.rb +++ b/app/models/pet_state.rb @@ -77,7 +77,7 @@ class PetState < ActiveRecord::Base existing_swf_assets = SwfAsset.biology_assets.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.id] = swf_asset + existing_swf_assets_by_id[swf_asset.remote_id] = swf_asset end existing_relationships_by_swf_asset_id = {} unless pet_state.new_record?