gab-social/app/serializers/rest/status_pinned_serializer.rb

23 lines
355 B
Ruby
Raw Normal View History

2020-11-25 21:22:37 +00:00
# frozen_string_literal: true
class REST::StatusPinnedSerializer < ActiveModel::Serializer
attributes :status_id, :account_id, :pinned
def status_id
object.id.to_s
end
def account_id
current_user.account.id
end
def pinned
if !current_user.nil?
current_user.account.pinned?(object)
else
false
end
end
end