method

resolve

Importance_2
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: 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"})
Show source
Register or log in to add new notes.