Class: Slavery::Transaction

Inherits:
Object
  • Object
show all
Defined in:
lib/slavery/transaction.rb

Class Method Summary collapse

Class Method Details

.base_depthObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/slavery/transaction.rb', line 4

def base_depth
  @base_depth ||= begin
    testcase = ActiveSupport::TestCase
    if defined?(testcase) &&
        testcase.respond_to?(:use_transactional_fixtures) &&
        testcase.try(:use_transactional_fixtures)
      1
    else
      0
    end
  end
end