Sha256: 86f66f4b83649534b60842ff7deb062b9a5bc29092be32b19edad6dc41c334cd

Contents?: true

Size: 720 Bytes

Versions: 1

Compression:

Stored size: 720 Bytes

Contents

module ActiveRecord # :nodoc:
  # The only difference here is that we use klass.connection_pool_name
  # instead of klass.name as the pool key
  module ConnectionAdapters # :nodoc:
    class ConnectionHandler # :nodoc:

      def retrieve_connection_pool(klass)
        pool = @connection_pools[klass.connection_pool_name]
        return pool if pool
        return nil if ActiveRecord::Base == klass
        retrieve_connection_pool klass.superclass
      end

      def remove_connection(klass)
        pool = @connection_pools[klass.connection_pool_name]
        @connection_pools.delete_if { |key, value| value == pool }
        pool.disconnect! if pool
        pool.spec.config if pool
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
replica-1.2.0 lib/replica/connection_pool.rb