method

configs_for

Importance_2
v7.0.0 - Show latest stable - 0 notes - Class: DatabaseConfigurations
configs_for(env_name: nil, name: nil, include_replicas: false, include_hidden: false) public

Collects the configs for the environment and optionally the specification name passed in. To include replica configurations pass include_hidden: 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: Deprecated. 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.

  • <tt>include_hidden:</tte Determines whether to include replicas and configurations hidden by +database_tasks: false+ in the returned list. Most of the time we’re only iterating over the primary connections (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.