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

Version Path
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/database_cleaner-1.2.0/lib/database_cleaner/sequel/transaction.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/database_cleaner-1.2.0/lib/database_cleaner/sequel/transaction.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/database_cleaner-1.2.0/lib/database_cleaner/sequel/transaction.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/database_cleaner-1.2.0/lib/database_cleaner/sequel/transaction.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/database_cleaner-1.2.0/lib/database_cleaner/sequel/transaction.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/database_cleaner-1.2.0/lib/database_cleaner/sequel/transaction.rb
raffle_v1-0.0.5 lib/database_cleaner-0.7.2/lib/database_cleaner/sequel/transaction.rb
database_cleaner-1.2.0 lib/database_cleaner/sequel/transaction.rb
database_cleaner-1.1.1 lib/database_cleaner/sequel/transaction.rb
database_cleaner-1.1.0 lib/database_cleaner/sequel/transaction.rb
database_cleaner-1.0.1 lib/database_cleaner/sequel/transaction.rb
database_cleaner-1.0.0.RC1 lib/database_cleaner/sequel/transaction.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.9.1/lib/database_cleaner/sequel/transaction.rb
database_cleaner-0.9.1 lib/database_cleaner/sequel/transaction.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/lib/database_cleaner/sequel/transaction.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/lib/database_cleaner/sequel/transaction.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/lib/database_cleaner/sequel/transaction.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/lib/database_cleaner/sequel/transaction.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/lib/database_cleaner/sequel/transaction.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/lib/database_cleaner/sequel/transaction.rb