diaspora/app/serializers/export/user_serializer.rb
cmrd Senya 6d9fa06e32 Include a private key to the user data export archive
In order to allow a user to notify his contacts of his migration
with a trustworthy signature the old private key must be available
to the new pod where we import data.
2016-02-25 13:38:24 +03:00

24 lines
791 B
Ruby

module Export
class UserSerializer < ActiveModel::Serializer
attributes :name,
:email,
:language,
:username,
:serialized_private_key,
:disable_mail,
:show_community_spotlight_in_stream,
:auto_follow_back,
:auto_follow_back_aspect,
:strip_exif
has_one :profile, serializer: Export::ProfileSerializer
has_many :aspects, each_serializer: Export::AspectSerializer
has_many :contacts, each_serializer: Export::ContactSerializer
has_many :posts, each_serializer: Export::PostSerializer
has_many :comments, each_serializer: Export::CommentSerializer
def comments
object.person.comments
end
end
end