Class: Argus::Trail::AuditEntry
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Argus::Trail::AuditEntry
- Defined in:
- app/models/argus/trail/audit_entry.rb
Overview
Immutable log of every role assignment/revocation on an actor, and every
permission granted/revoked on a role. subject is the actor for
role_assigned/role_revoked events, or the Role for
permission_granted/permission_revoked events.
Instance Method Summary collapse
Instance Method Details
#changed_by_label ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/models/argus/trail/audit_entry.rb', line 22 def changed_by_label return "System" if changed_by.nil? changed_by.try(:argus_trail_display_name) || changed_by.try(:name) || changed_by.try(:email) || "#{changed_by.class.name} ##{changed_by.id}" end |
#permission_name ⇒ Object
20 |
# File 'app/models/argus/trail/audit_entry.rb', line 20 def = &.name || &.dig("permission_name") |
#role_name ⇒ Object
19 |
# File 'app/models/argus/trail/audit_entry.rb', line 19 def role_name = role&.name || &.dig("role_name") |
#subject_label ⇒ Object
30 31 32 33 34 35 |
# File 'app/models/argus/trail/audit_entry.rb', line 30 def subject_label subject.try(:argus_trail_display_name) || subject.try(:name) || subject.try(:email) || "#{subject.class.name} ##{subject.id}" end |