Module: Audited::Auditor::AuditedInstanceMethods

Defined in:
lib/audited_async.rb

Instance Method Summary collapse

Instance Method Details

#audited_async_enabled?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/audited_async.rb', line 55

def audited_async_enabled?
  self.class.audited_async_enabled?
end

#perform_async_audit(method, changes = nil) ⇒ Object



79
80
81
82
83
84
85
86
87
88
# File 'lib/audited_async.rb', line 79

def perform_async_audit(method, changes = nil)
  AuditedAsync.config
              .job
              .set(AuditedAsync.config.job_options)
              .perform_later class_name: self.class.name,
                             record_id: send(self.class.primary_key.to_sym),
                             action: method,
                             audited_changes: (changes || audited_attributes).to_json,
                             comment: audit_comment
end