chinwagsocial/app/serializers/activitypub/hashtag_serializer.rb
Takeshi Umeda 74ead7d106
Change featured tag updates to add/remove activity (#19409)
* Change featured tag updates to add/remove activity

* Fix to check for the existence of feature tag

* Rename service and worker

* Merge AddHashtagSerializer with AddSerializer

* Undo removal of sidekiq_options
2022-10-22 18:30:55 +02:00

26 lines
420 B
Ruby

# frozen_string_literal: true
class ActivityPub::HashtagSerializer < ActivityPub::Serializer
context_extensions :hashtag
include RoutingHelper
attributes :type, :href, :name
def type
'Hashtag'
end
def name
"##{object.display_name}"
end
def href
if object.instance_of?(FeaturedTag)
short_account_tag_url(object.account, object.tag)
else
tag_url(object)
end
end
end