diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2018-08-30 13:07:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-30 13:07:02 -0400 |
commit | 8f2caec401c8e97d9eb1ea84d8263911c50e1ed6 (patch) | |
tree | 5845f95505c0cc35c62e55434b0b45e1104a2d60 /railties | |
parent | 616afba436b16210c03c323f698e2c3603f16a9f (diff) | |
parent | fdf3f0b9306ba8145e6e3acb84a50e5d23dfe48c (diff) | |
download | rails-8f2caec401c8e97d9eb1ea84d8263911c50e1ed6.tar.gz rails-8f2caec401c8e97d9eb1ea84d8263911c50e1ed6.tar.bz2 rails-8f2caec401c8e97d9eb1ea84d8263911c50e1ed6.zip |
Merge pull request #33637 from eileencodes/ar-connection-management-refactoring
Refactor Active Record configurations
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/application/rake/multi_dbs_test.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/railties/test/application/rake/multi_dbs_test.rb b/railties/test/application/rake/multi_dbs_test.rb index 07d96fcb56..f86bb9641f 100644 --- a/railties/test/application/rake/multi_dbs_test.rb +++ b/railties/test/application/rake/multi_dbs_test.rb @@ -127,36 +127,36 @@ EOS test "db:create and db:drop works on all databases for env" do require "#{app_path}/config/environment" - ActiveRecord::Base.configurations[Rails.env].each do |namespace, config| - db_create_and_drop namespace, config["database"] + ActiveRecord::Base.configurations.configs_for(Rails.env).each do |db_config| + db_create_and_drop db_config.spec_name, db_config.config["database"] end end test "db:create:namespace and db:drop:namespace works on specified databases" do require "#{app_path}/config/environment" - ActiveRecord::Base.configurations[Rails.env].each do |namespace, config| - db_create_and_drop_namespace namespace, config["database"] + ActiveRecord::Base.configurations.configs_for(Rails.env).each do |db_config| + db_create_and_drop_namespace db_config.spec_name, db_config.config["database"] end end test "db:migrate and db:schema:dump and db:schema:load works on all databases" do require "#{app_path}/config/environment" - ActiveRecord::Base.configurations[Rails.env].each do |namespace, config| - db_migrate_and_schema_dump_and_load namespace, config["database"], "schema" + ActiveRecord::Base.configurations.configs_for(Rails.env).each do |db_config| + db_migrate_and_schema_dump_and_load db_config.spec_name, db_config.config["database"], "schema" end end test "db:migrate and db:structure:dump and db:structure:load works on all databases" do require "#{app_path}/config/environment" - ActiveRecord::Base.configurations[Rails.env].each do |namespace, config| - db_migrate_and_schema_dump_and_load namespace, config["database"], "structure" + ActiveRecord::Base.configurations.configs_for(Rails.env).each do |db_config| + db_migrate_and_schema_dump_and_load db_config.spec_name, db_config.config["database"], "structure" end end test "db:migrate:namespace works" do require "#{app_path}/config/environment" - ActiveRecord::Base.configurations[Rails.env].each do |namespace, config| - db_migrate_namespaced namespace, config["database"] + ActiveRecord::Base.configurations.configs_for(Rails.env).each do |db_config| + db_migrate_namespaced db_config.spec_name, db_config.config["database"] end end end |