Class: DatabaseCleaner::ActiveShard::Transaction
- Inherits:
-
Object
- Object
- DatabaseCleaner::ActiveShard::Transaction
- Includes:
- Base
- Defined in:
- lib/active_shard/database_cleaner/transaction.rb
Instance Method Summary collapse
Instance Method Details
#clean ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/active_shard/database_cleaner/transaction.rb', line 14 def clean for_each_shard do |c| if c.open_transactions > 0 c.rollback_db_transaction c.decrement_open_transactions end end end |
#start ⇒ Object
7 8 9 10 11 12 |
# File 'lib/active_shard/database_cleaner/transaction.rb', line 7 def start for_each_shard do |c| c.increment_open_transactions c.begin_db_transaction end end |