Sha256: a212b161035da8f0ee968316cfbf3eb17c0cd94d6ae7f8d3368aa78d759964f7

Contents?: true

Size: 797 Bytes

Versions: 1

Compression:

Stored size: 797 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activeadmin-audit-0.1.2 lib/active_admin/audit/engine.rb