mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
rollback transaction records to deal with after_hook problems #99
This commit is contained in:
parent
737d2dc4a8
commit
d6584cc394
1 changed files with 5 additions and 0 deletions
|
@ -21,6 +21,11 @@ module DatabaseCleaner::ActiveRecord
|
|||
|
||||
connection_class.connection.rollback_db_transaction
|
||||
|
||||
# The below is for handling after_commit hooks.. see https://github.com/bmabey/database_cleaner/issues/99
|
||||
if connection_class.connection.respond_to?(:rollback_transaction_records)
|
||||
connection_class.connection.send(:rollback_transaction_records, true)
|
||||
end
|
||||
|
||||
if connection_class.connection.respond_to?(:decrement_open_transactions)
|
||||
connection_class.connection.decrement_open_transactions
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue