Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorThorsten Claus <thorstenclaus@web.de>2021-07-02 09:33:45 +0300
committerBenjamin Neff <benjamin@coding4coffee.ch>2021-07-03 03:51:41 +0300
commitb31f9106a12cd2ea60f6d1689bc562f819830f61 (patch)
tree763d8e80bbe7d6a4d48352d6a1599c560a0d8807 /app
parent7b73002a2c21e6998b44dd9bc5775e168ef009a2 (diff)
Migration: Exporting user blocks
closes #8263
Diffstat (limited to 'app')
-rw-r--r--app/models/block.rb2
-rw-r--r--app/serializers/export/user_serializer.rb7
2 files changed, 7 insertions, 2 deletions
diff --git a/app/models/block.rb b/app/models/block.rb
index 147361cac..48254071a 100644
--- a/app/models/block.rb
+++ b/app/models/block.rb
@@ -4,7 +4,7 @@ class Block < ApplicationRecord
belongs_to :person
belongs_to :user
- delegate :name, to: :person, prefix: true
+ delegate :name, :diaspora_handle, to: :person, prefix: true
validates :person_id, uniqueness: {scope: :user_id}
diff --git a/app/serializers/export/user_serializer.rb b/app/serializers/export/user_serializer.rb
index f1c4db5a3..dcf435b6b 100644
--- a/app/serializers/export/user_serializer.rb
+++ b/app/serializers/export/user_serializer.rb
@@ -10,7 +10,8 @@ module Export
:show_community_spotlight_in_stream,
:auto_follow_back,
:auto_follow_back_aspect,
- :strip_exif
+ :strip_exif,
+ :blocks
has_one :profile, serializer: FederationEntitySerializer
has_many :contact_groups, each_serializer: Export::AspectSerializer
has_many :contacts, each_serializer: Export::ContactSerializer
@@ -45,6 +46,10 @@ module Export
}
end
+ def blocks
+ object.blocks.map(&:person_diaspora_handle)
+ end
+
%i[comments likes poll_participations].each {|collection|
delegate collection, to: :person
}