023d4f6f2f
Signed-off-by: Rémy Coutable <remy@rymai.me>
9 lines
200 B
Ruby
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
|