diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2018-02-21 16:32:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-21 16:32:31 -0500 |
commit | 16f279ebd474626577ced858e3626ac4535a33df (patch) | |
tree | bf15ff7c0af67908148ab97935785d30480e403c | |
parent | 6c6a30a7c357ce1eafa093d77d2b08684fe50887 (diff) | |
parent | bf0495de58ed4a0f4f5b5e079c3e758d6b6b132c (diff) | |
download | rails-16f279ebd474626577ced858e3626ac4535a33df.tar.gz rails-16f279ebd474626577ced858e3626ac4535a33df.tar.bz2 rails-16f279ebd474626577ced858e3626ac4535a33df.zip |
Merge pull request #32075 from eileencodes/delete-default-configuration
Delete default configuration
-rw-r--r-- | activerecord/lib/active_record/tasks/database_tasks.rb | 4 | ||||
-rw-r--r-- | activerecord/test/cases/tasks/database_tasks_test.rb | 16 | ||||
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 1 |
3 files changed, 1 insertions, 20 deletions
diff --git a/activerecord/lib/active_record/tasks/database_tasks.rb b/activerecord/lib/active_record/tasks/database_tasks.rb index d8e0cd1e30..0883e80d23 100644 --- a/activerecord/lib/active_record/tasks/database_tasks.rb +++ b/activerecord/lib/active_record/tasks/database_tasks.rb @@ -315,16 +315,12 @@ module ActiveRecord environments << "test" if environment == "development" ActiveRecord::Base.configurations.slice(*environments).each do |configuration_environment, configuration| - next unless configuration["database"] - yield configuration, configuration_environment end end def each_local_configuration ActiveRecord::Base.configurations.each_value do |configuration| - next unless configuration["database"] - if local_database?(configuration) yield configuration else diff --git a/activerecord/test/cases/tasks/database_tasks_test.rb b/activerecord/test/cases/tasks/database_tasks_test.rb index 21226352ff..da7ca27f13 100644 --- a/activerecord/test/cases/tasks/database_tasks_test.rb +++ b/activerecord/test/cases/tasks/database_tasks_test.rb @@ -124,14 +124,6 @@ module ActiveRecord ActiveRecord::Base.connection_handler.stubs(:establish_connection) end - def test_ignores_configurations_without_databases - @configurations["development"].merge!("database" => nil) - - ActiveRecord::Tasks::DatabaseTasks.expects(:create).never - - ActiveRecord::Tasks::DatabaseTasks.create_all - end - def test_ignores_remote_databases @configurations["development"].merge!("host" => "my.server.tld") $stderr.stubs(:puts).returns(nil) @@ -250,14 +242,6 @@ module ActiveRecord ActiveRecord::Base.stubs(:configurations).returns(@configurations) end - def test_ignores_configurations_without_databases - @configurations[:development].merge!("database" => nil) - - ActiveRecord::Tasks::DatabaseTasks.expects(:drop).never - - ActiveRecord::Tasks::DatabaseTasks.drop_all - end - def test_ignores_remote_databases @configurations[:development].merge!("host" => "my.server.tld") $stderr.stubs(:puts).returns(nil) diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 1f765f302c..84595342b2 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -178,6 +178,7 @@ module Rails values.reverse_merge!(shared) end end + loaded_yaml.delete("default") Hash.new(shared).merge(loaded_yaml) elsif ENV["DATABASE_URL"] # Value from ENV['DATABASE_URL'] is set to default database connection |