mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-26 20:36:25 +00:00
14 lines
281 B
Ruby
14 lines
281 B
Ruby
# frozen_string_literal: true
|
|
|
|
class REST::CollectionItemSerializer < ActiveModel::Serializer
|
|
delegate :accepted?, to: :object
|
|
|
|
attributes :id, :position, :state
|
|
|
|
belongs_to :account, serializer: REST::AccountSerializer, if: :accepted?
|
|
|
|
def id
|
|
object.id.to_s
|
|
end
|
|
end
|