aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_one_association.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-06-08 00:14:27 +0100
committerJon Leighton <j@jonathanleighton.com>2011-06-08 00:32:49 +0100
commit4f5f6a3257862c0893c89a69321025e5873585dc (patch)
tree66a853f83b96a4e6a51febbcb4562f2101bb1304 /activerecord/lib/active_record/associations/has_one_association.rb
parenta1e78cfc36960569cf8cd380d9656ac6c14015ae (diff)
downloadrails-4f5f6a3257862c0893c89a69321025e5873585dc.tar.gz
rails-4f5f6a3257862c0893c89a69321025e5873585dc.tar.bz2
rails-4f5f6a3257862c0893c89a69321025e5873585dc.zip
When you add a record to a polymorphic has_one, you should be able to access the owner from the associated record
Diffstat (limited to 'activerecord/lib/active_record/associations/has_one_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/has_one_association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb
index 2f3a6e71f1..6b8201973a 100644
--- a/activerecord/lib/active_record/associations/has_one_association.rb
+++ b/activerecord/lib/active_record/associations/has_one_association.rb
@@ -14,8 +14,8 @@ module ActiveRecord
end
if record
- set_inverse_instance(record)
set_owner_attributes(record)
+ set_inverse_instance(record)
if owner.persisted? && save && !record.save
nullify_owner_attributes(record)