gab-social/app/serializers/rest/chat_message_serializer.rb
2020-12-15 19:31:30 -05:00

24 lines
466 B
Ruby

# frozen_string_literal: true
class REST::ChatMessageSerializer < ActiveModel::Serializer
attributes :id, :text_html, :text, :language, :from_account_id,
:chat_conversation_id, :created_at, :expires_at
def id
object.id.to_s
end
def text_html
Formatter.instance.chatMessageText(object).strip
end
def from_account_id
object.from_account_id.to_s
end
def chat_conversation_id
object.chat_conversation_id.to_s
end
end