mastodon/app/serializers/rest/collection_item_serializer.rb
2026-01-23 10:22:37 +00:00

18 lines
286 B
Ruby

# frozen_string_literal: true
class REST::CollectionItemSerializer < ActiveModel::Serializer
delegate :accepted?, to: :object
attributes :id, :state
attribute :account_id, if: :accepted?
def id
object.id.to_s
end
def account_id
object.account_id.to_s
end
end