diff options
Diffstat (limited to 'activerecord/lib/active_record/associations/preloader/association.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/preloader/association.rb | 10 |
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 323f25e37e..1e2d6c4f1e 100644 --- a/activerecord/lib/active_record/associations/preloader/association.rb +++ b/activerecord/lib/active_record/associations/preloader/association.rb @@ -27,16 +27,16 @@ module ActiveRecord raise NotImplementedError end - # The name of the key on the model which declares the association - def owner_key_name - raise NotImplementedError - end - private def options reflection.options end + # The name of the key on the model which declares the association + def owner_key_name + reflection.join_foreign_key + end + def associated_records_by_owner(preloader) records = load_records do |record| owner = owners_by_key[convert_key(record[association_key_name])] |