discourse/plugins/chat/app/serializers/chat_in_reply_to_serializer.rb
Roman Rizzi 0a5f548635
DEV: Move discourse-chat to the core repo. (#18776)
As part of this move, we are also renaming `discourse-chat` to `chat`.
2022-11-02 10:41:30 -03:00

17 lines
396 B
Ruby

# frozen_string_literal: true
class ChatInReplyToSerializer < ApplicationSerializer
has_one :user, serializer: BasicUserSerializer, embed: :objects
has_one :chat_webhook_event, serializer: ChatWebhookEventSerializer, embed: :objects
attributes :id, :cooked, :excerpt
def excerpt
WordWatcher.censor(object.excerpt)
end
def user
object.user || DeletedChatUser.new
end
end