From a1aa86b99e298c4a2b7a2e5da7a1bb9d8ba65a3b Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Mon, 18 Sep 2017 11:42:29 +0900 Subject: The name of the key on the owner is abstracted as `reflection.join_foreign_key` --- activerecord/lib/active_record/associations/preloader/belongs_to.rb | 4 ---- 1 file changed, 4 deletions(-) (limited to 'activerecord/lib/active_record/associations/preloader/belongs_to.rb') diff --git a/activerecord/lib/active_record/associations/preloader/belongs_to.rb b/activerecord/lib/active_record/associations/preloader/belongs_to.rb index ae9695f26a..62df4f5530 100644 --- a/activerecord/lib/active_record/associations/preloader/belongs_to.rb +++ b/activerecord/lib/active_record/associations/preloader/belongs_to.rb @@ -7,10 +7,6 @@ module ActiveRecord def association_key_name options[:primary_key] || klass && klass.primary_key end - - def owner_key_name - reflection.foreign_key - end end end end -- cgit v1.2.3 From dae16f8cd5908a0accfaf280d89b47b757c4bf2d Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Mon, 18 Sep 2017 12:14:20 +0900 Subject: The name of the key on the associated record is abstracted as `reflection.join_primary_key` --- activerecord/lib/active_record/associations/preloader/belongs_to.rb | 3 --- 1 file changed, 3 deletions(-) (limited to 'activerecord/lib/active_record/associations/preloader/belongs_to.rb') diff --git a/activerecord/lib/active_record/associations/preloader/belongs_to.rb b/activerecord/lib/active_record/associations/preloader/belongs_to.rb index 62df4f5530..a8e3340b23 100644 --- a/activerecord/lib/active_record/associations/preloader/belongs_to.rb +++ b/activerecord/lib/active_record/associations/preloader/belongs_to.rb @@ -4,9 +4,6 @@ module ActiveRecord module Associations class Preloader class BelongsTo < SingularAssociation #:nodoc: - def association_key_name - options[:primary_key] || klass && klass.primary_key - end end end end -- cgit v1.2.3 From de40c45f2b7d4a2ba47d28e9a4967134e45df91f Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Wed, 8 Nov 2017 22:21:12 +0900 Subject: Remove useless preloader classes They are only different by one line of code which doesn't deserve a hierarchy of 7 classes. Closes #31079. [Ryuta Kamizono & Bogdan Gusiev] --- .../lib/active_record/associations/preloader/belongs_to.rb | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 activerecord/lib/active_record/associations/preloader/belongs_to.rb (limited to 'activerecord/lib/active_record/associations/preloader/belongs_to.rb') diff --git a/activerecord/lib/active_record/associations/preloader/belongs_to.rb b/activerecord/lib/active_record/associations/preloader/belongs_to.rb deleted file mode 100644 index a8e3340b23..0000000000 --- a/activerecord/lib/active_record/associations/preloader/belongs_to.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -module ActiveRecord - module Associations - class Preloader - class BelongsTo < SingularAssociation #:nodoc: - end - end - end -end -- cgit v1.2.3