Class: ActiveRecordAuditable::BaseAudit

Inherits:
ApplicationRecord show all
Defined in:
app/models/active_record_auditable/base_audit.rb

Direct Known Subclasses

Audit

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.inherited(child) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'app/models/active_record_auditable/base_audit.rb', line 4

def self.inherited(child)
  super

  child.include ActiveRecordAuditable::ActsAsJson

  child.acts_as_json :audited_changes
  child.acts_as_json :extra_liquid_variables
  child.acts_as_json :params
end

Instance Method Details

#action=(action_name) ⇒ Object



20
21
22
# File 'app/models/active_record_auditable/base_audit.rb', line 20

def action=(action_name)
  self.audit_action = ActiveRecordAuditable::AuditAction.find_or_create_by!(action: action_name)
end