diaspora/app/serializers/export/contact_serializer.rb
cmrd Senya 7374661e2f
Update the user data export archive format.
This commit introduces changes to the user data export archive format.
This extends data set which is included in the archive. This data can be
then imported to other pods when this feature is implemented.

Also the commit adds the archive format json schema. ATM it is used in
automatic tests only, but in future it will also be used to validate
incoming archives.
2017-08-10 09:36:26 +03:00

34 lines
642 B
Ruby

module Export
class ContactSerializer < ActiveModel::Serializer
attributes :sharing,
:receiving,
:following,
:followed,
:person_guid,
:person_name,
:account_id,
:public_key
has_many :contact_groups_membership
def following
object.sharing
end
def followed
object.receiving
end
def account_id
object.person_diaspora_handle
end
def contact_groups_membership
object.aspects.map(&:name)
end
def public_key
object.person.serialized_public_key
end
end
end