<commit_before>module Slavery
  class Transaction
    class << self
      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<commit_msg>Corrects transactional fixture check for Rails 5<commit_after>module Slavery
  class Transaction
    # The methods on ActiveSupport::TestCase which can potentially be used
    # to determine if transactional fixtures are enabled
    TEST_CONFIG_METHODS = [
      :use_transactional_tests,
      :use_transactional_fixtures
    ]

    class << self
      def base_depth
        @base_depth ||= if defined?(ActiveSupport::TestCase) &&
          TEST_CONFIG_METHODS.any? { |m| ActiveSupport::TestCase.try(m) }
        then
          1
        else
          0
{'fraction_non_alphanumeric': 0.06871035940803383, 'fraction_numerical': 0.005285412262156448, 'mean_word_length': 2.2881944444444446, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2981459', 'n_tokens_mistral': 254, 'n_tokens_neox': 250, 'n_words': 62}