Expose reaction ids
This commit is contained in:
parent
0a6eaa16dc
commit
2ab563e06c
1 changed files with 6 additions and 1 deletions
|
@ -5,7 +5,8 @@ class REST::StatusReactionSerializer < ActiveModel::Serializer
|
|||
|
||||
attributes :name
|
||||
|
||||
attribute :me, if: :current_user?
|
||||
attribute :id, unless: :no_id?
|
||||
attribute :me, if: :current_user? # are this and count worth keeping?
|
||||
attribute :url, if: :custom_emoji?
|
||||
attribute :static_url, if: :custom_emoji?
|
||||
attribute :count, if: :respond_to_count?
|
||||
|
@ -18,6 +19,10 @@ class REST::StatusReactionSerializer < ActiveModel::Serializer
|
|||
object.respond_to?(:count)
|
||||
end
|
||||
|
||||
def no_id?
|
||||
object.id.nil?
|
||||
end
|
||||
|
||||
def current_user?
|
||||
!current_user.nil?
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue