discourse/plugins/chat/app/serializers/chat_in_reply_to_serializer.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
396 B
Ruby
Raw Normal View History

# 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