Welcome to mirror list, hosted at ThFree Co, Russian Federation.

database_connection_helpers.rb « helpers « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 10ea7b5de919555e4c506b72f321e477fe55c89a (plain)
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true

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