Fix emoji_reaction notification error in feather

This commit is contained in:
KMY 2023-06-01 08:39:34 +09:00
parent 8b621d30b4
commit b43135db83

View file

@ -5,7 +5,7 @@ class REST::NotifyEmojiReactionSerializer < ActiveModel::Serializer
attributes :name
attribute :count, if: :count?
attribute :count
attribute :url, if: :custom_emoji?
attribute :static_url, if: :custom_emoji?
attribute :domain, if: :custom_emoji?
@ -16,6 +16,10 @@ class REST::NotifyEmojiReactionSerializer < ActiveModel::Serializer
object.respond_to?(:count)
end
def count
count? ? object.count : 1
end
def custom_emoji?
object.respond_to?(:custom_emoji) && object.custom_emoji.present?
end