method

configs_for

Importance_2
v6.1.7.7 - Show latest stable - 0 notes - Class: DatabaseConfigurations
configs_for(env_name: nil, spec_name: nil, name: nil, include_replicas: false) public

Collects the configs for the environment and optionally the specification name passed in. To include replica configurations pass include_replicas: true.

If a name is provided a single DatabaseConfig object will be returned, otherwise an array of DatabaseConfig objects will be returned that corresponds with the environment and type requested.

Options

  • env_name: The environment name. Defaults to nil which will collect configs for all environments.

  • name: The db config name (i.e. primary, animals, etc.). Defaults to nil. If no env_name is specified the config for the default env and the passed name will be returned.

  • include_replicas: Determines whether to include replicas in the returned list. Most of the time we’re only iterating over the write connection (i.e. migrations don’t need to run for the write and read connection). Defaults to false.

Show source
Register or log in to add new notes.