Permalink
Browse files

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
  • Loading branch information...
1 parent 2bdaff4 commit 7411af95dbafd48934d737a2fdad8255946c269a @dhh dhh committed Jun 7, 2005
Showing with 1 addition and 0 deletions.
  1. +1 −0 activerecord/lib/active_record/associations/has_one_association.rb
@@ -20,6 +20,7 @@ def build(attributes = {}, replace_existing = true)
replace(record, true)
else
record[@association_class_primary_key_name] = @owner.id unless @owner.new_record?
+ self.target = record
end
record

0 comments on commit 7411af9

Please sign in to comment.