mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 15:58:50 +00:00
16 lines
462 B
Ruby
16 lines
462 B
Ruby
# frozen_string_literal: true
|
|
|
|
class REST::CollectionSerializer < ActiveModel::Serializer
|
|
attributes :uri, :name, :description, :local, :sensitive, :discoverable,
|
|
:created_at, :updated_at
|
|
|
|
belongs_to :account, serializer: REST::AccountSerializer
|
|
belongs_to :tag, serializer: REST::StatusSerializer::TagSerializer
|
|
|
|
has_many :items, serializer: REST::CollectionItemSerializer
|
|
|
|
def items
|
|
object.items_for(current_user&.account)
|
|
end
|
|
end
|