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

16 lines
349 B
Ruby

# frozen_string_literal: true
class REST::CollectionWithAccountsSerializer < ActiveModel::Serializer
belongs_to :collection, serializer: REST::CollectionSerializer
has_many :accounts, serializer: REST::AccountSerializer
def collection
object
end
def accounts
[object.account] + object.collection_items.map(&:account)
end
end