Files
mastodon/app/serializers/rest/collection_item_serializer.rb
2025-12-12 13:09:55 +00:00

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