Module: Decidim::Core::AuthorableInterface

Includes:
Api::Types::BaseInterface
Defined in:
lib/decidim/api/interfaces/authorable_interface.rb

Overview

This interface represents a commentable object.

Instance Method Summary collapse

Instance Method Details

#authorObject



14
15
16
17
18
19
20
21
# File 'lib/decidim/api/interfaces/authorable_interface.rb', line 14

def author
  author = if object.respond_to?(:normalized_author)
             object&.normalized_author
           elsif object.respond_to?(:creator_identity)
             object&.creator_identity
           end
  author if author.is_a?(Decidim::UserBaseEntity)
end