Class: MnoEnterprise::AuditEvent

Inherits:
BaseResource show all
Defined in:
app/models/mno_enterprise/audit_event.rb

Instance Method Summary collapse

Methods inherited from BaseResource

#==, base_class, #cache_key, #clear_association_cache, #clear_attribute_changes!, exists?, find_by, first, last, #max_updated_column_timestamp, #read_attribute, #reload, #save, #save!, #update, #write_attribute

Methods included from HerExtension::Validations::RemoteUniquenessValidation

included

Instance Method Details

#format_serialized_detailsObject



14
15
16
17
18
19
# File 'app/models/mno_enterprise/audit_event.rb', line 14

def format_serialized_details
  AUDIT_LOG_CONFIG.fetch('events', {}).fetch(key, '') % details.symbolize_keys
rescue KeyError => e
  e.message
  # details.inspect
end

#formatted_detailsObject



3
4
5
6
7
8
9
10
11
12
# File 'app/models/mno_enterprise/audit_event.rb', line 3

def formatted_details
  case details
    when String
      details
    when Hash
      format_serialized_details
    else
      nil
  end
end