about summary refs log tree commit diff
path: root/app/serializers/activitypub/collection_serializer.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-02-28 22:02:36 +0100
committerGitHub <noreply@github.com>2019-02-28 22:02:36 +0100
commitb969b150e8f095dc91c19c7381923c2c19edb968 (patch)
tree015d70b4b633fadf70cab9d0a0b0fbd55e6456ae /app/serializers/activitypub/collection_serializer.rb
parent76ed481aa7b67d624675cdaa85bac583853fd24d (diff)
parent2267eee356a3d2b8ebb20892c5182b6f8169403e (diff)
Merge pull request #932 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/serializers/activitypub/collection_serializer.rb')
-rw-r--r--app/serializers/activitypub/collection_serializer.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/serializers/activitypub/collection_serializer.rb b/app/serializers/activitypub/collection_serializer.rb
index e8960131b..b03609957 100644
--- a/app/serializers/activitypub/collection_serializer.rb
+++ b/app/serializers/activitypub/collection_serializer.rb
@@ -7,7 +7,8 @@ class ActivityPub::CollectionSerializer < ActiveModel::Serializer
     super
   end
 
-  attributes :id, :type
+  attribute :id, if: -> { object.id.present? }
+  attribute :type
   attribute :total_items, if: -> { object.size.present? }
   attribute :next, if: -> { object.next.present? }
   attribute :prev, if: -> { object.prev.present? }
@@ -37,6 +38,6 @@ class ActivityPub::CollectionSerializer < ActiveModel::Serializer
   end
 
   def page?
-    object.part_of.present?
+    object.part_of.present? || object.page.present?
   end
 end