diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-02-28 21:35:53 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-02-28 21:35:53 +0100 |
commit | 2267eee356a3d2b8ebb20892c5182b6f8169403e (patch) | |
tree | 015d70b4b633fadf70cab9d0a0b0fbd55e6456ae /app/serializers/activitypub/collection_serializer.rb | |
parent | 76ed481aa7b67d624675cdaa85bac583853fd24d (diff) | |
parent | ee7d79c0ce411ff7754e3ac31dbf27cb9e298f73 (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/serializers/activitypub/collection_serializer.rb')
-rw-r--r-- | app/serializers/activitypub/collection_serializer.rb | 5 |
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 |