Skip to content

Commit

Permalink
Simplified code [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Nov 8, 2022
1 parent 45827cb commit 4d3ad94
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test/multiple_databases_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,12 @@ def test_target_version_unconfigured
def with_multiple_dbs(&block)
previous_db_config = ActiveRecord::Base.connection_db_config.configuration_hash

multi_db_config = {
ActiveRecord::Base.configurations = {
"test" => {
"primary" => previous_db_config,
"animals" => previous_db_config
}
}
ActiveRecord::Base.configurations = multi_db_config
ActiveRecord::Base.connects_to(database: {writing: :primary})
yield
ensure
Expand Down

0 comments on commit 4d3ad94

Please sign in to comment.