You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
386 B

  1. # frozen_string_literal: true
  2. class ActivityPub::OutboxSerializer < ActivityPub::CollectionSerializer
  3. def self.serializer_for(model, options)
  4. if model.class.name == 'ActivityPub::ActivityPresenter'
  5. ActivityPub::ActivitySerializer
  6. else
  7. super
  8. end
  9. end
  10. def items
  11. object.items.map { |status| ActivityPub::ActivityPresenter.from_status(status) }
  12. end
  13. end