method

resolve_symbol_connection

Importance_2
v6.0.0 - Show latest stable - 0 notes - Class: Resolver
resolve_symbol_connection(env_name, pool_name) private

Takes the environment such as :production or :development and a pool name the corresponds to the name given by the connection pool to the connection. That pool name is merged into the hash with the name key.

This requires that the @configurations was initialized with a key that matches.

configurations = #<ActiveRecord::DatabaseConfigurations:0x00007fd9fdace3e0
  @configurations=[
    #<ActiveRecord::DatabaseConfigurations::HashConfig:0x00007fd9fdace250
      @env_name="production", @spec_name="primary", @config={"database"=>"my_db"}>
    ]>

Resolver.new(configurations).resolve_symbol_connection(:production, "primary")
# => { "database" => "my_db" }
Show source
Register or log in to add new notes.