From dda5501e80cb98bbe119ac2f9fcf9b7049e121ce Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Tue, 26 Feb 2019 04:45:13 +0900 Subject: Enable SQL statement cache for `find` on base class as with `find_by` Related and follows d333d85254d27cd572e6ecce8ee850c107a4f340. --- activerecord/lib/active_record/core.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/core.rb') diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index 18cfac1f2f..eb4b48bc37 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -161,7 +161,7 @@ module ActiveRecord return super if block_given? || primary_key.nil? || scope_attributes? || - columns_hash.include?(inheritance_column) + columns_hash.key?(inheritance_column) && !base_class? id = ids.first -- cgit v1.2.3