aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/core.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-02-26 04:45:13 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-03-01 16:28:32 +0900
commitdda5501e80cb98bbe119ac2f9fcf9b7049e121ce (patch)
treed56d3c35cd554729654a64a5ee692fa1681e88c3 /activerecord/lib/active_record/core.rb
parent357aa83f84695a31328b17be4080f8ab4993fcb8 (diff)
downloadrails-dda5501e80cb98bbe119ac2f9fcf9b7049e121ce.tar.gz
rails-dda5501e80cb98bbe119ac2f9fcf9b7049e121ce.tar.bz2
rails-dda5501e80cb98bbe119ac2f9fcf9b7049e121ce.zip
Enable SQL statement cache for `find` on base class as with `find_by`
Related and follows d333d85254d27cd572e6ecce8ee850c107a4f340.
Diffstat (limited to 'activerecord/lib/active_record/core.rb')
-rw-r--r--activerecord/lib/active_record/core.rb2
1 files changed, 1 insertions, 1 deletions
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