1# frozen_string_literal: true 2 3module DatabaseConnectionHelpers 4 def run_with_new_database_connection 5 pool = ActiveRecord::Base.connection_pool 6 conn = pool.checkout 7 yield conn 8 ensure 9 pool.checkin(conn) 10 end 11end 12