Add custom emoji size recording and publish api
This commit is contained in:
parent
47bedd20ca
commit
92df4674ff
6 changed files with 36 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue