Skip to content

Commit

Permalink
Fixed test warning with Active Record 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Nov 8, 2022
1 parent 4d7608a commit 45827cb
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions test/multiple_databases_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,15 @@ def with_multiple_dbs(&block)

multi_db_config = {
"test" => {
"primary" => {
"adapter" => $adapter,
"database" => "strong_migrations_test"
},
"animals" => {
"adapter" => $adapter,
"database" => "animals_test"
}
"primary" => previous_db_config,
"animals" => previous_db_config
}
}
ActiveRecord::Base.configurations = multi_db_config
ActiveRecord::Base.connects_to(database: {writing: :primary})
yield
ensure
ActiveRecord::Base.establish_connection(previous_db_config)
ActiveRecord::Base.establish_connection(previous_db_config) if previous_db_config
end

def multiple_dbs?
Expand Down

0 comments on commit 45827cb

Please sign in to comment.