aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/statement_cache.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2016-02-11 08:54:58 -0700
committerSean Griffin <sean@seantheprogrammer.com>2016-02-11 08:54:58 -0700
commit2a56b2d90d4fed8548e3a1e7a7b206454858c872 (patch)
tree47af48e0929ad7e145f112aa0433584f4e3bfdac /activerecord/lib/active_record/statement_cache.rb
parent3a7a021ed936af50d436f419ac651203cfd072f6 (diff)
downloadrails-2a56b2d90d4fed8548e3a1e7a7b206454858c872.tar.gz
rails-2a56b2d90d4fed8548e3a1e7a7b206454858c872.tar.bz2
rails-2a56b2d90d4fed8548e3a1e7a7b206454858c872.zip
Ensure prepared statement caching still occurs with Adequate Record
In Rails 5, we're much more restrictive about when we do or don't cache a prepared statement. In particular, we never cache when we are sending an IN statement or a SQL string literal However, in the case of Adequate Record, we are *always* sending a raw SQL string, and we *always* want to cache the result. Fixes #23507 /cc @tgxworld
Diffstat (limited to 'activerecord/lib/active_record/statement_cache.rb')
-rw-r--r--activerecord/lib/active_record/statement_cache.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/statement_cache.rb b/activerecord/lib/active_record/statement_cache.rb
index f6b0efb88a..6c896ccea6 100644
--- a/activerecord/lib/active_record/statement_cache.rb
+++ b/activerecord/lib/active_record/statement_cache.rb
@@ -106,7 +106,7 @@ module ActiveRecord
sql = query_builder.sql_for bind_values, connection
- klass.find_by_sql sql, bind_values
+ klass.find_by_sql(sql, bind_values, preparable: true)
end
alias :call :execute
end