Method: AuditLoggable::AuditRecord#as_json
- Defined in:
- lib/audit_loggable/audit_record.rb
#as_json(options = nil) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/audit_loggable/audit_record.rb', line 14 def as_json( = nil) { auditable: { id: auditable.id, type: auditable.class.polymorphic_name }, user: user ? { id: user.id, type: user.class.polymorphic_name } : nil, action: action, changes: changeset.to_json, # serialize to JSON string remote_address: remote_address, request_uuid: request_uuid }.as_json() end |