Class: Dscf::Core::AuditLogSerializer
- Inherits:
-
ActiveModel::Serializer
- Object
- ActiveModel::Serializer
- Dscf::Core::AuditLogSerializer
- Defined in:
- app/serializers/dscf/core/audit_log_serializer.rb
Class Method Summary collapse
Class Method Details
.actor_display_name(actor) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/serializers/dscf/core/audit_log_serializer.rb', line 25 def self.actor_display_name(actor) return nil unless actor if actor.respond_to?(:full_name) && actor.full_name.present? actor.full_name elsif actor.respond_to?(:name) && actor.name.present? actor.name elsif actor.respond_to?(:email) actor.email else "#{actor.class.name.demodulize} ##{actor.id}" end end |