method
resolve
rails latest stable - Class:
ActiveRecord::DatabaseConfigurations
resolve(config)public
Returns fully resolved connection, accepts hash, string or symbol. Always returns a DatabaseConfiguration::DatabaseConfig
Examples
Symbol representing current environment.
DatabaseConfigurations.new("production" => {}).resolve(:production) # => DatabaseConfigurations::HashConfig.new(env_name: "production", config: {})
One layer deep hash of connection values.
DatabaseConfigurations.new({}).resolve("adapter" => "sqlite3") # => DatabaseConfigurations::HashConfig.new(config: {"adapter" => "sqlite3"})
Connection URL.
DatabaseConfigurations.new({}).resolve("postgresql://localhost/foo") # => DatabaseConfigurations::UrlConfig.new(config: {"adapter" => "postgresql", "host" => "localhost", "database" => "foo"})