about summary refs log tree commit diff
path: root/app/serializers/activitypub/follow_serializer.rb
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2018-01-08 09:48:42 -0600
committerDavid Yip <yipdw@member.fsf.org>2018-01-08 09:48:42 -0600
commit65986b6f0b66ea285b89bb82531067db146d8ecc (patch)
tree6c69dd7748ef1cd9ccc8cb1af32a4f27ca23586a /app/serializers/activitypub/follow_serializer.rb
parent2dc4fbbd1a13adbdca26a0b42ee6e289e736bba1 (diff)
parentf839ac694c3f8050e4c7ec84884283e35f6ac662 (diff)
Merge remote-tracking branch 'personal/merge/tootsuite/master' into gs-master
Diffstat (limited to 'app/serializers/activitypub/follow_serializer.rb')
-rw-r--r--app/serializers/activitypub/follow_serializer.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/app/serializers/activitypub/follow_serializer.rb b/app/serializers/activitypub/follow_serializer.rb
index eecd64701..86c9992fe 100644
--- a/app/serializers/activitypub/follow_serializer.rb
+++ b/app/serializers/activitypub/follow_serializer.rb
@@ -1,12 +1,11 @@
 # frozen_string_literal: true
 
 class ActivityPub::FollowSerializer < ActiveModel::Serializer
-  attributes :type, :actor
-  attribute :id, if: :dereferencable?
+  attributes :id, :type, :actor
   attribute :virtual_object, key: :object
 
   def id
-    ActivityPub::TagManager.instance.uri_for(object)
+    [ActivityPub::TagManager.instance.uri_for(object.account), '#follows/', object.id].join
   end
 
   def type
@@ -20,8 +19,4 @@ class ActivityPub::FollowSerializer < ActiveModel::Serializer
   def virtual_object
     ActivityPub::TagManager.instance.uri_for(object.target_account)
   end
-
-  def dereferencable?
-    object.respond_to?(:object_type)
-  end
 end