mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 15:58:50 +00:00
Emoji: Update emoji categories with featured emoji (#37084)
This commit is contained in:
@@ -8,6 +8,7 @@ class REST::CustomEmojiSerializer < ActiveModel::Serializer
|
||||
attributes :shortcode, :url, :static_url, :visible_in_picker
|
||||
|
||||
attribute :category, if: :category_loaded?
|
||||
attribute :featured, if: :category_loaded?
|
||||
|
||||
def url
|
||||
full_asset_url(object.image.url)
|
||||
@@ -21,6 +22,10 @@ class REST::CustomEmojiSerializer < ActiveModel::Serializer
|
||||
object.category.name
|
||||
end
|
||||
|
||||
def featured
|
||||
object.featured?
|
||||
end
|
||||
|
||||
def category_loaded?
|
||||
object.association(:category).loaded? && object.category.present?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user