From 8cde75813d54b92a894fb47d296929e8a6d26ba1 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Mon, 18 Sep 2017 12:29:44 +0900 Subject: Remove unused delegation to `reflection.options` in `Preloader::Association` --- activerecord/lib/active_record/associations/preloader/association.rb | 4 ---- .../lib/active_record/associations/preloader/through_association.rb | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/associations/preloader/association.rb b/activerecord/lib/active_record/associations/preloader/association.rb index 8101c5604b..fe696e0d6e 100644 --- a/activerecord/lib/active_record/associations/preloader/association.rb +++ b/activerecord/lib/active_record/associations/preloader/association.rb @@ -23,10 +23,6 @@ module ActiveRecord 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) diff --git a/activerecord/lib/active_record/associations/preloader/through_association.rb b/activerecord/lib/active_record/associations/preloader/through_association.rb index 53e9c14823..fa32cc5553 100644 --- a/activerecord/lib/active_record/associations/preloader/through_association.rb +++ b/activerecord/lib/active_record/associations/preloader/through_association.rb @@ -80,6 +80,7 @@ module ActiveRecord def through_scope scope = through_reflection.klass.unscoped + options = reflection.options if options[:source_type] scope.where! reflection.foreign_type => options[:source_type] -- cgit v1.2.3