Sha256: 2af00e95ab29b5f059c52a7c0792c787668b9fb149c28f8a54b3061ade42d601

Contents?: true

Size: 1007 Bytes

Versions: 5

Compression:

Stored size: 1007 Bytes

Contents

# frozen_string_literal: true

require "active_record"

module VelocityAudited
  class << self
    attr_accessor \
      :auditing_enabled,
      :current_user_method,
      :ignored_attributes,
      :max_audits,
      :store_synthesized_enums
    attr_writer :audit_class

    def audit_class
      @audit_class ||= Audit
    end

    def store
      current_store_value = Thread.current.thread_variable_get(:audited_store)

      if current_store_value.nil?
        Thread.current.thread_variable_set(:audited_store, {})
      else
        current_store_value
      end
    end

    def config
      yield(self)
    end
  end

  @ignored_attributes = %w[lock_version created_at updated_at created_on updated_on]

  @current_user_method = :current_user
  @auditing_enabled = true
  @store_synthesized_enums = false
end

require "audited/auditor"

ActiveSupport.on_load :active_record do
  require "audited/audit"
  include VelocityAudited::Auditor
end

require "audited/sweeper"
require "audited/railtie"

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
velocity_audited-6.0.4 lib/velocity_audited.rb
velocity_audited-6.0.3 lib/velocity_audited.rb
velocity_audited-6.0.1 lib/velocity_audited.rb
velocity_audited-5.1.6 lib/velocity_audited.rb
velocity_audited-5.1.5 lib/velocity_audited.rb