Class: ActiveShard::ActiveRecord::ConnectionHandler::ConnectionPoolHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/active_shard/active_record/connection_handler.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection_handler) ⇒ ConnectionPoolHash



142
143
144
# File 'lib/active_shard/active_record/connection_handler.rb', line 142

def initialize( connection_handler )
  @connection_handler = connection_handler
end

Instance Method Details

#[](val) ⇒ Object



146
147
148
149
150
151
152
153
# File 'lib/active_shard/active_record/connection_handler.rb', line 146

def [](val)
  case val
  when PoolKey
    super
  else
    @connection_handler.retrieve_connection_pool( val.constantize )
  end
end