diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-07 12:48:37 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-07 12:48:37 +0000 |
commit | 7411af95dbafd48934d737a2fdad8255946c269a (patch) | |
tree | 300558ce02e87deeb8ab0ab1a3ff58c0aa8b75ff /activerecord/lib | |
parent | 2bdaff4a4e9a3813b4e4e24ff3d3b0aa53b088fc (diff) | |
download | rails-7411af95dbafd48934d737a2fdad8255946c269a.tar.gz rails-7411af95dbafd48934d737a2fdad8255946c269a.tar.bz2 rails-7411af95dbafd48934d737a2fdad8255946c269a.zip |
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
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/has_one_association.rb | 1 |
1 files changed, 1 insertions, 0 deletions
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 |