From 116658e69b9c4a722e6ae8717629b8cd0057db89 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 3 Mar 2006 06:25:39 +0000 Subject: Fixed that calling HasOneProxy#build_model repeatedly would cause saving to happen (closes #4058) [anna@wota.jp] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3753 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/associations/has_one_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb index d07323a869..65f584c6f9 100644 --- a/activerecord/lib/active_record/associations/has_one_association.rb +++ b/activerecord/lib/active_record/associations/has_one_association.rb @@ -34,7 +34,7 @@ module ActiveRecord @owner.clear_association_cache else @target[@reflection.primary_key_name] = nil - @target.save unless @owner.new_record? + @target.save unless @owner.new_record? || @target.new_record? end end -- cgit v1.2.3