Class: AuditedAsync::AuditAsyncJob

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
lib/audited_async/audit_async_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(args) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/audited_async/audit_async_job.rb', line 6

def perform(args)
  klass, id, changes = extract_auditing_elements(args)

  record = klass.unscoped.find_by(klass.primary_key.to_sym => id)

  return alert_record_not_found(klass, id) unless record

  record.send(:write_audit, changes)
end