diff options
author | Eugene Kenny <elkenny@gmail.com> | 2017-04-24 23:26:13 +0100 |
---|---|---|
committer | Eugene Kenny <elkenny@gmail.com> | 2017-04-24 23:26:13 +0100 |
commit | 11e32c1d841c08bd85842eb059fbf30536e804dc (patch) | |
tree | e683ed2f1901d11747f60e3dd6673342a16dd964 /activerecord/test | |
parent | 0dd40fe72cfcf53b475a4084d61e9e931417c29e (diff) | |
download | rails-11e32c1d841c08bd85842eb059fbf30536e804dc.tar.gz rails-11e32c1d841c08bd85842eb059fbf30536e804dc.tar.bz2 rails-11e32c1d841c08bd85842eb059fbf30536e804dc.zip |
Enable query cache on all connection pools
Since the query cache no longer eagerly checks out a connection, we can
enable it on all connection pools at the start of every request, and it
will only take effect for requests that actually use those pools.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/query_cache_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/query_cache_test.rb b/activerecord/test/cases/query_cache_test.rb index 494663eb04..210199c977 100644 --- a/activerecord/test/cases/query_cache_test.rb +++ b/activerecord/test/cases/query_cache_test.rb @@ -426,6 +426,15 @@ class QueryCacheTest < ActiveRecord::TestCase end end + def test_query_cache_is_enabled_on_all_connection_pools + middleware { + ActiveRecord::Base.connection_handler.connection_pool_list.each do |pool| + assert pool.query_cache_enabled + assert pool.connection.query_cache_enabled + end + }.call({}) + end + private def middleware(&app) executor = Class.new(ActiveSupport::Executor) |