Fix emoji_reaction notification error in feather
This commit is contained in:
parent
8b621d30b4
commit
b43135db83
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue