aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/preloader/association.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/associations/preloader/association.rb')
-rw-r--r--activerecord/lib/active_record/associations/preloader/association.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/associations/preloader/association.rb b/activerecord/lib/active_record/associations/preloader/association.rb
index 1e2d6c4f1e..8101c5604b 100644
--- a/activerecord/lib/active_record/associations/preloader/association.rb
+++ b/activerecord/lib/active_record/associations/preloader/association.rb
@@ -22,16 +22,16 @@ module ActiveRecord
end
end
- # The name of the key on the associated records
- def association_key_name
- raise NotImplementedError
- end
-
private
def options
reflection.options
end
+ # The name of the key on the associated records
+ def association_key_name
+ reflection.join_primary_key(klass)
+ end
+
# The name of the key on the model which declares the association
def owner_key_name
reflection.join_foreign_key