<commit_before>require 'rails/engine'

module ActiveAdmin
  module Audit
    class Engine < Rails::Engine
      isolate_namespace ActiveAdmin::Audit

      initializer 'load_config_initializers' do |app|
        PaperTrail.serializer = PaperTrail::Serializers::JSON

        app_path = File.expand_path('../../../../app/admin', __FILE__)
        ActiveAdmin.application.load_paths.unshift(app_path)

        module ActiveAdmin::ViewHelpers
          include ActiveAdmin::VersionsHelper
        end

        ActiveAdmin.setup do |config|
          config.before_filter :set_paper_trail_whodunnit
        end
      end

      initializer 'active_record.set_configs' do
        ActiveSupport.on_load(:active_record) do
          include ActiveAdmin::Audit::HasVersions
        end
      end
    end
  end
end<commit_msg>Do not trigger activeadmin setup inside initializer<commit_after>require 'rails/engine'

module ActiveAdmin
  module Audit
    class Engine < Rails::Engine
      isolate_namespace ActiveAdmin::Audit

      initializer 'load_config_initializers' do |app|
        PaperTrail.serializer = PaperTrail::Serializers::JSON

        app_path = File.expand_path('../../../../app/admin', __FILE__)
        ActiveAdmin.application.load_paths.unshift(app_path)

        module ActiveAdmin::ViewHelpers
          include ActiveAdmin::VersionsHelper
        end

        ActiveAdmin.before_load do |config|
          config.before_filter :set_paper_trail_whodunnit
        end
      end

      initializer 'active_record.set_configs' do
        ActiveSupport.on_load(:active_record) do
          include ActiveAdmin::Audit::HasVersions
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.07866507747318235, 'fraction_numerical': 0.0, 'mean_word_length': 2.756152125279642, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6937815', 'n_tokens_mistral': 475, 'n_tokens_neox': 462, 'n_words': 95}