lib/velocity_audited.rb in velocity_audited-5.1.4 vs lib/velocity_audited.rb in velocity_audited-5.1.5
- old
+ new
@@ -1,53 +1,49 @@
+# frozen_string_literal: true
+
require "active_record"
module VelocityAudited
- # frozen_string_literal: true
- #
- module Audited
- class << self
- attr_accessor \
+ class << self
+ attr_accessor \
:auditing_enabled,
:current_user_method,
:ignored_attributes,
:max_audits,
:store_synthesized_enums
- attr_writer :audit_class
+ attr_writer :audit_class
- def audit_class
- @audit_class ||= Audit
- end
+ def audit_class
+ @audit_class ||= Audit
+ end
- def store
- current_store_value = Thread.current.thread_variable_get(:audited_store)
+ 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
+ if current_store_value.nil?
+ Thread.current.thread_variable_set(:audited_store, {})
+ else
+ current_store_value
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
+ def config
+ yield(self)
+ end
end
- require "audited/auditor"
+ @ignored_attributes = %w[lock_version created_at updated_at created_on updated_on]
- ActiveSupport.on_load :active_record do
- require "audited/audit"
- include Audited::Auditor
- end
+ @current_user_method = :current_user
+ @auditing_enabled = true
+ @store_synthesized_enums = false
+end
- require "audited/sweeper"
- require "audited/railtie"
+require "audited/auditor"
+ActiveSupport.on_load :active_record do
+ require "audited/audit"
+ include VelocityAudited::Auditor
+end
-end
\ No newline at end of file
+require "audited/sweeper"
+require "audited/railtie"