Add emoji alias-names support
This commit is contained in:
parent
dd05f2b58c
commit
8638e715cb
9 changed files with 42 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue