diff options
author | Pier-Olivier Thibault <pothibo@gmail.com> | 2014-05-07 16:03:23 -0400 |
---|---|---|
committer | Pier-Olivier Thibault <pothibo@gmail.com> | 2014-05-07 18:18:00 -0400 |
commit | d14fab04ff4c32c283c7bc86c8b53b872e0fb51c (patch) | |
tree | 1e903cdfa04f8750e61db2b0a701abb78353acbc /railties/lib/rails | |
parent | 37c1e47da09fba4ee76143da05bbd4faabbaa53e (diff) | |
download | rails-d14fab04ff4c32c283c7bc86c8b53b872e0fb51c.tar.gz rails-d14fab04ff4c32c283c7bc86c8b53b872e0fb51c.tar.bz2 rails-d14fab04ff4c32c283c7bc86c8b53b872e0fb51c.zip |
Use Rails::Paths::Path#existent in database_configuration
Database configuration was trying to load the first path that
config.paths['config/database'] was returning even if the path didn't
exist in the filesystem.
Because Rails::Paths::Path has the possibility to return more than 1
path (as an array), database_configuration should filter down the paths
to the existing one and then load the first one.
This would make it possible to move the database.yml file and add the
new path to paths['config/database'] and still load the configurations.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 4c449d2c57..5e8f4de847 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -92,7 +92,7 @@ module Rails # Loads and returns the entire raw configuration of database from # values stored in `config/database.yml`. def database_configuration - yaml = Pathname.new(paths["config/database"].first || "") + yaml = Pathname.new(paths["config/database"].existent.first || "") config = if yaml.exist? require "yaml" |