Sha256: 91141404102b63755b2f5c587f7dfbc212778c3128593797f0d4eef87ac06e45
Contents?: true
Size: 628 Bytes
Versions: 8
Compression:
Stored size: 628 Bytes
Contents
# frozen_string_literal: true module DatabaseFlusher module ActiveRecord class TransactionStrategy def start # Hack to make sure that the connection is properly setup for # the clean code. ::ActiveRecord::Base.connection.transaction{ } ::ActiveRecord::Base.connection.begin_transaction joinable: false end def stop ::ActiveRecord::Base.connection_pool.connections.each do |connection| next unless connection.open_transactions > 0 connection.rollback_transaction end end def clean stop end end end end
Version data entries
8 entries across 8 versions & 1 rubygems