Skip to content

A platform for community discussion. Free, open, simple.

DEV: Reduce size of begin-rescue region

Daniel Waterworth368af327fada
diff --git a/lib/turbo_tests/runner.rb b/lib/turbo_tests/runner.rb
index 3faff70dc35..808e18a28ea 100644
--- a/lib/turbo_tests/runner.rb
+++ b/lib/turbo_tests/runner.rb
@@ -87,14 +87,15 @@ module TurboTests
ActiveRecord::Tasks::DatabaseTasks.migrations_paths = ['db/migrate', 'db/post_migrate']
+ conn = ActiveRecord::Base.establish_connection(config).connection
+
begin
- conn = ActiveRecord::Base.establish_connection(config).connection
ActiveRecord::Migration.check_pending!(conn)
rescue ActiveRecord::PendingMigrationError
puts "There are pending migrations, run rake parallel:migrate"
exit 1
ensure
- conn&.close
+ conn.close
end
end