mirror of
https://github.com/mastodon/mastodon.git
synced 2026-04-25 07:56:08 -05:00
18 lines
286 B
Ruby
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
|