闭社主体 forked from https://github.com/tootsuite/mastodon
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.

22 lines
500 B

  1. # frozen_string_literal: true
  2. class ActivityPub::ActivitySerializer < ActivityPub::Serializer
  3. def self.serializer_for(model, options)
  4. case model.class.name
  5. when 'Status'
  6. ActivityPub::NoteSerializer
  7. when 'DeliverToDeviceService::EncryptedMessage'
  8. ActivityPub::EncryptedMessageSerializer
  9. else
  10. super
  11. end
  12. end
  13. attributes :id, :type, :actor, :published, :to, :cc
  14. has_one :virtual_object, key: :object
  15. def published
  16. object.published.iso8601
  17. end
  18. end