diff options
author | schneems <richard.schneeman@gmail.com> | 2014-02-21 16:04:21 -0600 |
---|---|---|
committer | schneems <richard.schneeman@gmail.com> | 2014-02-21 16:18:10 -0600 |
commit | 283a2edec2f8ccdf90fb58025608f02a63948fa0 (patch) | |
tree | 73ab84eda4ca5766409c75dc31486c2a1128bfcb /activerecord/lib/active_record/tasks | |
parent | 467cb908dd5f40cbfefe41b93e219682a3ced535 (diff) | |
download | rails-283a2edec2f8ccdf90fb58025608f02a63948fa0.tar.gz rails-283a2edec2f8ccdf90fb58025608f02a63948fa0.tar.bz2 rails-283a2edec2f8ccdf90fb58025608f02a63948fa0.zip |
Handle missing environment from non empty config
If using a `DATABASE_URL` and a `database.yml`. The connection information in `DATABASE_URL` should be merged into whatever environment we are in. As released in 4.1.0rc1 if someone has a database.yml but is missing a key like production:
```yml
development:
host: localhost
```
Then the check for blank config will return false so the information from the `DATABASE_URL` will not be used when attempting to connect to the `production` database and the connection will incorrectly fail.
This commit fixes this problem and adds a test for the behavior.
In addition the ability to specify a connection url in a `database.yml` like this:
```
production: postgres://localhost/foo
```
Was introduced in 4.1.0rc1 though should not be used, instead using a url sub key
```
production:
url: postgres://localhost/foo
```
This url sub key was also introduced in 4.1.0rc1 though the `production: postgres://localhost/foo` was not removed. As a result we should not test this behavior.
Diffstat (limited to 'activerecord/lib/active_record/tasks')
0 files changed, 0 insertions, 0 deletions