aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/reflection.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/reflection.rb')
-rw-r--r--activerecord/lib/active_record/reflection.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index 97f1a83033..d044f9dfe8 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -305,13 +305,17 @@ module ActiveRecord
end
def get_join_keys(association_klass)
- JoinKeys.new(join_pk(association_klass), join_fk)
+ JoinKeys.new(join_pk(association_klass), join_foreign_key)
end
def build_scope(table, predicate_builder = predicate_builder(table))
Relation.create(klass, table, predicate_builder)
end
+ def join_foreign_key
+ active_record_primary_key
+ end
+
protected
def actual_source_reflection # FIXME: this is a horrible name
self
@@ -325,10 +329,6 @@ module ActiveRecord
def join_pk(_)
foreign_key
end
-
- def join_fk
- active_record_primary_key
- end
end
# Base class for AggregateReflection and AssociationReflection. Objects of
@@ -754,16 +754,16 @@ module ActiveRecord
owner[foreign_key]
end
+ def join_foreign_key
+ foreign_key
+ end
+
private
def calculate_constructable(macro, options)
!polymorphic?
end
- def join_fk
- foreign_key
- end
-
def join_pk(klass)
polymorphic? ? association_primary_key(klass) : association_primary_key
end