Add emoji alias-names support

This commit is contained in:
KMY 2023-05-22 10:44:32 +09:00
parent dd05f2b58c
commit 8638e715cb
9 changed files with 42 additions and 6 deletions

View file

@ -8,6 +8,7 @@ class REST::CustomEmojiSerializer < ActiveModel::Serializer
attribute :category, if: :category_loaded?
attribute :width, if: :width?
attribute :height, if: :height?
attribute :aliases, if: :aliases?
def url
full_asset_url(object.image.url)
@ -40,4 +41,8 @@ class REST::CustomEmojiSerializer < ActiveModel::Serializer
def height
object.respond_to?(:image_height) ? object.image_height : object.height
end
def aliases?
object.respond_to?(:aliases) && object.aliases.present?
end
end