diff options
author | eileencodes <eileencodes@gmail.com> | 2018-02-22 07:56:09 -0500 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2018-02-22 07:56:09 -0500 |
commit | 0979713abe2e22083e1beca01a1d113408c9ab36 (patch) | |
tree | df24e68d2f4fcd1a73ae3583df3c30fe696def90 /railties/lib | |
parent | 9c0c90979a759a41628e0cd9d73821b0b34d03fc (diff) | |
download | rails-0979713abe2e22083e1beca01a1d113408c9ab36.tar.gz rails-0979713abe2e22083e1beca01a1d113408c9ab36.tar.bz2 rails-0979713abe2e22083e1beca01a1d113408c9ab36.zip |
Reject empty database yamls
In #32075 I deleted the default configuration since that's what's
generated with the Rails app. Since someone could change the default
name instead delete any config that doesn't have a database so we can
avoid peppering our Rails tasks with conditionals to deal with invalid
database configs.
Diffstat (limited to 'railties/lib')
-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 84595342b2..9fbcea1b81 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -178,7 +178,7 @@ module Rails values.reverse_merge!(shared) end end - loaded_yaml.delete("default") + loaded_yaml.reject! { |_, values| !values["database"] } Hash.new(shared).merge(loaded_yaml) elsif ENV["DATABASE_URL"] # Value from ENV['DATABASE_URL'] is set to default database connection |