Sha256: 586e45368302b9185cd0bfac7a7eb804af5e9ca8661c56da5910fbb7359cccd2
Contents?: true
Size: 481 Bytes
Versions: 29
Compression:
Stored size: 481 Bytes
Contents
require 'database_cleaner/sequel/base' module DatabaseCleaner module Sequel class Transaction include ::DatabaseCleaner::Sequel::Base def start @fibers||= [] db= self.db f= Fiber.new do db.transaction(:rollback => :always, :savepoint => true) do Fiber.yield end end f.resume @fibers<< f end def clean f= @fibers.pop f.resume end end end end
Version data entries
29 entries across 18 versions & 5 rubygems