Sha256: 9ef9562c183d0d13f140ceb917822359da997d2f73a002d033d6c3b55ad322db

Contents?: true

Size: 780 Bytes

Versions: 16

Compression:

Stored size: 780 Bytes

Contents

require 'database_cleaner/active_record/base'
module DatabaseCleaner::ActiveRecord
  class Transaction
    include ::DatabaseCleaner::ActiveRecord::Base

    def start
      if connection_klass.connection.respond_to?(:increment_open_transactions)
        connection_klass.connection.increment_open_transactions
      else
        connection_klass.__send__(:increment_open_transactions)
      end
      connection_klass.connection.begin_db_transaction
    end


    def clean
      connection_klass.connection.rollback_db_transaction

      if connection_klass.connection.respond_to?(:decrement_open_transactions)
        connection_klass.connection.decrement_open_transactions
      else
        connection_klass.__send__(:decrement_open_transactions)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
radiant-1.0.0 ruby-debug/ruby/1.8/gems/database_cleaner-0.6.7/lib/database_cleaner/active_record/transaction.rb
database_cleaner-0.7.0 lib/database_cleaner/active_record/transaction.rb
database_cleaner-0.6.7 lib/database_cleaner/active_record/transaction.rb
database_cleaner-0.6.7.RC lib/database_cleaner/active_record/transaction.rb
database_cleaner-0.6.6 lib/database_cleaner/active_record/transaction.rb
database_cleaner-0.6.5 lib/database_cleaner/active_record/transaction.rb
database_cleaner-0.6.4 lib/database_cleaner/active_record/transaction.rb
database_cleaner-0.6.3 lib/database_cleaner/active_record/transaction.rb
database_cleaner-0.6.2 lib/database_cleaner/active_record/transaction.rb
database_cleaner-0.6.1 lib/database_cleaner/active_record/transaction.rb
database_cleaner-0.6.1.rc2 lib/database_cleaner/active_record/transaction.rb
database_cleaner-0.6.1.rc lib/database_cleaner/active_record/transaction.rb
database_cleaner-0.6.0 lib/database_cleaner/active_record/transaction.rb
database_cleaner-0.6.0.rc.3 lib/database_cleaner/active_record/transaction.rb
database_cleaner-0.6.0.rc.2 lib/database_cleaner/active_record/transaction.rb
database_cleaner-0.6.0.rc.1 lib/database_cleaner/active_record/transaction.rb