method

configs_for

Importance_2
v7.1.3.2 - Show latest stable - 0 notes - Class: DatabaseConfigurations
configs_for(env_name: nil, name: nil, config_key: nil, 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.

  • config_key: Selects configs that contain a particular key in the configuration hash. Useful for selecting configs that use a custom db config handler or finding configs with hashes that contain a particular key.

  • include_hidden: 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.