Module: SidekiqTransactionGuard::DatabaseCleaner

Defined in:
lib/sidekiq_transaction_guard/database_cleaner.rb

Instance Method Summary collapse

Instance Method Details

#cleaning(&block) ⇒ Object

Wrap the `SidekiqTransactionGuard.testing` which sets up the data structures needed for custom counting of the transaction level within a test block.


18
19
20
# File 'lib/sidekiq_transaction_guard/database_cleaner.rb', line 18

def cleaning(&block)
  SidekiqTransactionGuard.testing{ super(&block) }
end

#startObject

Override the start method to set the base number of allowed transactions to the current level. Anything above this number will then be considered to be in a transaction.


10
11
12
13
14
# File 'lib/sidekiq_transaction_guard/database_cleaner.rb', line 10

def start
  retval = super
  SidekiqTransactionGuard.set_allowed_transaction_level(connection_class)
  retval
end