diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-04-05 11:35:47 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-05-01 01:32:36 +0900 |
commit | 9caa0cf57d2f73b3ad6c34f00c34b5fdf75fe8fd (patch) | |
tree | 53ba181a4e7eb26b955a2196c3bbfbc60e2b5b75 /activerecord/test | |
parent | 7cb71c5ce37b7bc599de851d44eaa6a948daec03 (diff) | |
download | rails-9caa0cf57d2f73b3ad6c34f00c34b5fdf75fe8fd.tar.gz rails-9caa0cf57d2f73b3ad6c34f00c34b5fdf75fe8fd.tar.bz2 rails-9caa0cf57d2f73b3ad6c34f00c34b5fdf75fe8fd.zip |
Deprecate `supports_statement_cache?`
`supports_statement_cache?` was introduced in 3.1.0.beta1 (104d0b2) for
bind parameter substitution, but it is no longer used in 3.1.0.rc1
(73ff679). Originally it should respect `prepared_statements` rather
than `supports_statement_cache?` (fd39847).
One more thing, named `supports_statement_cache?` is pretty misreading.
We have `StatementCache` and `StatementPool`. However,
`supports_statement_cache?` doesn't mean `StatementCache`, but
`StatementPool` unlike its name.
https://github.com/rails/rails/blob/v5.1.0/activerecord/lib/active_record/statement_cache.rb
https://github.com/rails/rails/blob/v5.1.0/activerecord/lib/active_record/connection_adapters/statement_pool.rb
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/bind_parameter_test.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/test/cases/bind_parameter_test.rb b/activerecord/test/cases/bind_parameter_test.rb index 6032aa9250..49fe219563 100644 --- a/activerecord/test/cases/bind_parameter_test.rb +++ b/activerecord/test/cases/bind_parameter_test.rb @@ -3,8 +3,7 @@ require "models/topic" require "models/author" require "models/post" -if ActiveRecord::Base.connection.supports_statement_cache? && - ActiveRecord::Base.connection.prepared_statements +if ActiveRecord::Base.connection.prepared_statements module ActiveRecord class BindParameterTest < ActiveRecord::TestCase fixtures :topics, :authors, :author_addresses, :posts @@ -66,6 +65,10 @@ if ActiveRecord::Base.connection.supports_statement_cache? && assert_logs_binds(binds) end + def test_deprecate_supports_statement_cache + assert_deprecated { ActiveRecord::Base.connection.supports_statement_cache? } + end + private def assert_logs_binds(binds) payload = { |