DEV: Reduce size of begin-rescue region

Follow-up-to: e3e7905d9e
This commit is contained in:
Daniel Waterworth 2020-06-23 10:12:31 +01:00
parent 84c12d8f3d
commit 368af327fa
1 changed files with 3 additions and 2 deletions

View File

@ -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