mirror of
https://github.com/mastodon/mastodon.git
synced 2026-04-24 15:18:46 -05:00
16 lines
349 B
Ruby
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
|