aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_one_through_association.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/associations/has_one_through_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/has_one_through_association.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/has_one_through_association.rb b/activerecord/lib/active_record/associations/has_one_through_association.rb
index 112b773ec4..426809f56f 100644
--- a/activerecord/lib/active_record/associations/has_one_through_association.rb
+++ b/activerecord/lib/active_record/associations/has_one_through_association.rb
@@ -12,7 +12,7 @@ module ActiveRecord
private
def create_through_record(record)
- through_proxy = @owner.association(@reflection.through_reflection.name)
+ through_proxy = owner.association(reflection.through_reflection.name)
through_record = through_proxy.send(:load_target)
if through_record && !record
@@ -22,7 +22,7 @@ module ActiveRecord
if through_record
through_record.update_attributes(attributes)
- elsif @owner.new_record?
+ elsif owner.new_record?
through_proxy.build(attributes)
else
through_proxy.create(attributes)