diff options
author | Eileen Uchitelle <eileencodes@gmail.com> | 2019-01-17 17:04:48 -0500 |
---|---|---|
committer | Eileen Uchitelle <eileencodes@gmail.com> | 2019-01-17 17:26:32 -0500 |
commit | 83b995206a569d8d08b697ee9f86a64ca1854bcc (patch) | |
tree | e4eb4f50445e20b701da8f104bd0f2508fd79aee /railties/test/application/multiple_applications_test.rb | |
parent | 69c963c2e8ac56f4832e767c3c83091b9c6f24dd (diff) | |
download | rails-83b995206a569d8d08b697ee9f86a64ca1854bcc.tar.gz rails-83b995206a569d8d08b697ee9f86a64ca1854bcc.tar.bz2 rails-83b995206a569d8d08b697ee9f86a64ca1854bcc.zip |
Fix error message when adapter is not specified
When we added support for multiple databases through a 3-tiered config
and configuration objects this error message got a bit convoluted.
Previously if you had an application with a missing configuation and
multiple databases the error message would look like this:
```
'doesnexist' database is not configured. Available: development,
development, test, test, production, production
(ActiveRecord::AdapterNotSpecified)
```
That's not very descriptive since it duplicates the environments
(because there are multiple databases per environment for this
application).
To fix this I've constructed a bit more readable error message which now
reads like this if you have a multi db app:
```
The `doesntexist` database is not configured for the `production`
environment. (ActiveRecord::AdapterNotSpecified)
Available databases configurations are:
development: primary, primary_readonly
test: primary, primary_readonly
production: primary, primary_readonly
```
And like this if you have a single db app:
```
The `doesntexist` database is not configured for the `production`
environment. (ActiveRecord::AdapterNotSpecified)
Available databases configurations are:
development
test
```
This makes the error message more readable and presents the user all
available options for the database connections.
Diffstat (limited to 'railties/test/application/multiple_applications_test.rb')
0 files changed, 0 insertions, 0 deletions