Skip to content

Commit

Permalink
Fix explanation of ActiveRecord::Base.configurations.configs_for in…
Browse files Browse the repository at this point in the history
… the CHANGELOG

Since #33770 `#configs_for` changed method signature and it isn't
supposed to work with a passed block.
  • Loading branch information
bogdanvlviv committed Sep 9, 2018
1 parent 4f05ba7 commit 0f905b9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions activerecord/CHANGELOG.md
Expand Up @@ -24,7 +24,7 @@
a deprecation warning if used, however calling `ActiveRecord::Base.configurations`
will use the new version internally and externally.

For example, the following database.yml...
For example, the following `database.yml`:

```
development:
Expand All @@ -49,13 +49,14 @@

Iterating over the database configurations has also changed. Instead of
calling hash methods on the `configurations` hash directly, a new method `configs_for` has
been provided that allows you to select the correct configuration. `env_name` is a required
argument, `spec_name` is optional as well as passing a block. These return an array of
database config objects for the requested environment and specification name respectively.
been provided that allows you to select the correct configuration. `env_name`, and
`spec_name` arguments are optional. For example these return an array of
database config objects for the requested environment and a single database config object
will be returned for the requested environment and specification name respectively.

```
ActiveRecord::Base.configurations.configs_for("development")
ActiveRecord::Base.configurations.configs_for("development", "primary")
ActiveRecord::Base.configurations.configs_for(env_name: "development")
ActiveRecord::Base.configurations.configs_for(env_name: "development", spec_name: "primary")
```

*Eileen M. Uchitelle*, *Aaron Patterson*
Expand Down

0 comments on commit 0f905b9

Please sign in to comment.