Add emoji reaction detail status

This commit is contained in:
KMY 2023-02-26 23:44:52 +09:00
parent de951a0ef9
commit a1485f242d
22 changed files with 393 additions and 16 deletions

View file

@ -0,0 +1,34 @@
# frozen_string_literal: true
class REST::EmojiReactionAccountSerializer < ActiveModel::Serializer
include RoutingHelper
include FormattingHelper
attributes :id, :name
attribute :url, if: :custom_emoji?
attribute :static_url, if: :custom_emoji?
attribute :domain, if: :custom_emoji?
belongs_to :account, serializer: REST::AccountSerializer
def id
object.id.to_s
end
def url
full_asset_url(object.custom_emoji.image.url)
end
def static_url
full_asset_url(object.custom_emoji.image.url(:static))
end
def domain
object.custom_emoji.domain
end
def custom_emoji?
object.custom_emoji.present?
end
end