aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb b/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb
index 4f67b02d00..eef8041573 100644
--- a/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb
+++ b/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb
@@ -6,7 +6,7 @@ module ActiveRecord
def replace_keys(record)
super
- @owner[@reflection.foreign_type] = record && record.class.base_class.name
+ owner[reflection.foreign_type] = record && record.class.base_class.name
end
def different_target?(record)
@@ -14,11 +14,11 @@ module ActiveRecord
end
def inverse_reflection_for(record)
- @reflection.polymorphic_inverse_of(record.class)
+ reflection.polymorphic_inverse_of(record.class)
end
def target_klass
- type = @owner[@reflection.foreign_type]
+ type = owner[reflection.foreign_type]
type && type.constantize
end
@@ -27,7 +27,7 @@ module ActiveRecord
end
def stale_state
- [super, @owner[@reflection.foreign_type].to_s]
+ [super, owner[reflection.foreign_type].to_s]
end
end
end