Sha256: e2cdef9b4db3fe9101bbdd8874b64726a85a5863e396722d33c69aea98aeb6fc
Contents?: true
Size: 851 Bytes
Versions: 15
Compression:
Stored size: 851 Bytes
Contents
require 'database_cleaner/active_record/base' module DatabaseCleaner::ActiveRecord class Transaction include ::DatabaseCleaner::ActiveRecord::Base def start if connection_klass.connection.respond_to?(:increment_open_transactions) connection_klass.connection.increment_open_transactions else connection_klass.__send__(:increment_open_transactions) end connection_klass.connection.begin_db_transaction end def clean return unless connection_klass.connection.open_transactions > 0 connection_klass.connection.rollback_db_transaction if connection_klass.connection.respond_to?(:decrement_open_transactions) connection_klass.connection.decrement_open_transactions else connection_klass.__send__(:decrement_open_transactions) end end end end
Version data entries
15 entries across 10 versions & 4 rubygems