chinwagsocial/app/serializers/activitypub/hashtag_serializer.rb
Eugen Rochko e7aa2be828
Change how hashtags are normalized (#18795)
* Change how hashtags are normalized

* Fix tests
2022-07-13 15:03:28 +02:00

24 lines
389 B
Ruby

# frozen_string_literal: true
class ActivityPub::HashtagSerializer < ActivityPub::Serializer
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