This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2019-03-10 16:49:31 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-03-27 07:55:23 -07:00
|
|
|
class ActivityPub::UpdatePollSerializer < ActivityPub::Serializer
|
2019-03-10 16:49:31 -07:00
|
|
|
attributes :id, :type, :actor, :to
|
|
|
|
|
|
|
|
has_one :object, serializer: ActivityPub::NoteSerializer
|
|
|
|
|
|
|
|
def id
|
2019-03-27 20:44:59 -07:00
|
|
|
[ActivityPub::TagManager.instance.uri_for(object), '#updates/', object.preloadable_poll.updated_at.to_i].join
|
2019-03-10 16:49:31 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
def type
|
|
|
|
'Update'
|
|
|
|
end
|
|
|
|
|
|
|
|
def actor
|
|
|
|
ActivityPub::TagManager.instance.uri_for(object)
|
|
|
|
end
|
|
|
|
|
|
|
|
def to
|
|
|
|
ActivityPub::TagManager.instance.to(object)
|
|
|
|
end
|
|
|
|
|
|
|
|
def cc
|
|
|
|
ActivityPub::TagManager.instance.cc(object)
|
|
|
|
end
|
|
|
|
end
|