Class: DatabaseCleaner::Sequel::Transaction
- Defined in:
- lib/database_cleaner/sequel/transaction.rb
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#clean ⇒ Object
18 19 20 21 |
# File 'lib/database_cleaner/sequel/transaction.rb', line 18 def clean f = @fibers.pop f.resume end |
#start ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/database_cleaner/sequel/transaction.rb', line 6 def start @fibers ||= [] db = self.db f = Fiber.new do db.transaction(:rollback => :always, :savepoint => true, :auto_savepoint => true) do Fiber.yield end end f.resume @fibers << f end |