From 9c0c7b78cf2eaa5a8c507fbd7f516038b2ba21b6 Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 12 Jan 2012 22:02:12 -0600 Subject: [PATCH] another oops, better fix --- 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 8fa80883..b92c56a2 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -316,7 +316,7 @@ class Item < ActiveRecord::Base swf_asset.origin_pet_type = pet_type # Build and update the relationship - relationship = existing_relationships_by_item_id_and_swf_asset_id[item.id][swf_asset_id] rescue nil + relationship = existing_relationships_by_item_id_and_swf_asset_id[item.id][swf_asset.id] rescue nil unless relationship relationship = ParentSwfAssetRelationship.new relationship.parent = item diff --git a/app/models/pet_state.rb b/app/models/pet_state.rb index 9eebc709..de3c05c0 100644 --- a/app/models/pet_state.rb +++ b/app/models/pet_state.rb @@ -97,7 +97,7 @@ class PetState < ActiveRecord::Base end swf_asset.origin_biology_data = asset_info swf_asset.origin_pet_type = pet_type - relationship = existing_relationships_by_swf_asset_id[swf_asset_id] + relationship = existing_relationships_by_swf_asset_id[swf_asset.id] unless relationship relationship ||= ParentSwfAssetRelationship.new relationship.parent = pet_state