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
sunrise-cms-0.3.0 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.0 vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/lib/database_cleaner/sequel/transaction.rb
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.8.0/lib/database_cleaner/sequel/transaction.rb
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/lib/database_cleaner/sequel/transaction.rb
database_cleaner-0.8.0 lib/database_cleaner/sequel/transaction.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/lib/database_cleaner/sequel/transaction.rb
sunrise-cms-0.3.0.rc 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
rails-uploader-0.0.1 vendor/bundle/ruby/1.9.1/gems/database_cleaner-0.7.2/lib/database_cleaner/sequel/transaction.rb
database_cleaner-0.7.2 lib/database_cleaner/sequel/transaction.rb