Add custom emoji size recording and publish api

This commit is contained in:
KMY 2023-03-08 16:32:38 +09:00
parent 47bedd20ca
commit 92df4674ff
6 changed files with 36 additions and 2 deletions

View file

@ -3,7 +3,7 @@
class REST::CustomEmojiSerializer < ActiveModel::Serializer
include RoutingHelper
attributes :shortcode, :url, :static_url, :visible_in_picker
attributes :shortcode, :url, :static_url, :visible_in_picker, :width, :height
attribute :category, if: :category_loaded?
@ -22,4 +22,12 @@ class REST::CustomEmojiSerializer < ActiveModel::Serializer
def category_loaded?
object.association(:category).loaded? && object.category.present?
end
def width
object.image_width
end
def height
object.image_height
end
end