Skip to content

Commit

Permalink
fix tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ka8725 committed May 1, 2024
1 parent 244f60c commit 4b7a1ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/dummy_app/db/secondary_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 0) do
ActiveRecord::Schema[7.1].define(version: 2013_09_06_111513) do
end
10 changes: 6 additions & 4 deletions test/rake_task_secondary_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
end

around do |block|
ActiveRecord::Tasks::DatabaseTasks.with_temporary_connection(TestingState.db_config["secondary"]) do
utils.cleanup
block.call
end
original_db_config = ActiveRecord::Base.connection_db_config
ActiveRecord::Base.establish_connection(TestingState.db_config["secondary"])
utils.cleanup
block.call
ensure
ActiveRecord::Base.establish_connection(original_db_config)
end

describe "db:rollback_branches" do
Expand Down

0 comments on commit 4b7a1ef

Please sign in to comment.