From 7411af95dbafd48934d737a2fdad8255946c269a Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 7 Jun 2005 12:48:37 +0000 Subject: Replace the in-memory object, but dont orphan the existing one git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1393 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/associations/has_one_association.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb index a6a80083f4..4a6e85c8ee 100644 --- a/activerecord/lib/active_record/associations/has_one_association.rb +++ b/activerecord/lib/active_record/associations/has_one_association.rb @@ -20,6 +20,7 @@ module ActiveRecord replace(record, true) else record[@association_class_primary_key_name] = @owner.id unless @owner.new_record? + self.target = record end record -- cgit v1.2.3