debian-mirror-gitlab/spec/support/helpers/database_connection_helpers.rb
2018-10-15 14:42:47 +05:30

9 lines
200 B
Ruby

module DatabaseConnectionHelpers
def run_with_new_database_connection
pool = ActiveRecord::Base.connection_pool
conn = pool.checkout
yield conn
ensure
pool.checkin(conn)
end
end