instance method teardown_shared_connection_pool

Ruby on Rails edge

Since v6.0.6.1 Private — implementation detail, not part of the public API

Available in: v6.0.6.1 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3.2 v8.0.5.1 v8.1.3.1 edge

Signature

teardown_shared_connection_pool()

No documentation comment.

Source
# File activerecord/lib/active_record/test_fixtures.rb, line 267
      def teardown_shared_connection_pool
        handler = ActiveRecord::Base.connection_handler
        removed_pool_configs = []
        pool_managers = handler.send(:connection_name_to_pool_manager)

        @saved_pool_configs.each_pair do |name, shards|
          pool_manager = pool_managers[name]
          shards.each_pair do |shard_name, roles|
            roles.each_pair do |role, pool_config|
              if pool_manager.get_pool_config(role, shard_name)
                pool_manager.set_pool_config(role, shard_name, pool_config)
              else
                removed_pool_configs << pool_config
              end
            end
          end
        end

        @saved_pool_configs.clear

        remaining_pool_configs = pool_managers.values.flat_map(&:pool_configs)
        removed_pool_configs.compact.uniq.each do |pool_config|
          pool_config.disconnect! unless remaining_pool_configs.include?(pool_config)
        end
      end

Defined in activerecord/lib/active_record/test_fixtures.rb line 267 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::TestFixtures

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close