Skip to content
Extraits de code Groupes Projets
Valider 09dad2d8 rédigé par danielvincent's avatar danielvincent
Parcourir les fichiers

DG MS; exporter includes comments. exporter spec

parent 7e8bf40a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -4,11 +4,6 @@ ...@@ -4,11 +4,6 @@
module Diaspora module Diaspora
def self.bone(user)
exporter = Diaspora::Exporter.new(Diaspora::Exporters::XML)
exporter.execute(user)
end
class Exporter class Exporter
def initialize(strategy) def initialize(strategy)
self.class.send(:include, strategy) self.class.send(:include, strategy)
...@@ -22,7 +17,7 @@ module Diaspora ...@@ -22,7 +17,7 @@ module Diaspora
xml.user { xml.user {
xml.username user.username xml.username user.username
xml.serialized_private_key user.serialized_private_key xml.serialized_private_key user.serialized_private_key
xml.person user.person.to_xml xml.parent << user.person.to_xml
xml.aspects { xml.aspects {
user.aspects.each do |aspect| user.aspects.each do |aspect|
...@@ -36,8 +31,14 @@ module Diaspora ...@@ -36,8 +31,14 @@ module Diaspora
end end
} }
xml.posts { xml.posts {
aspect.posts.each do |post| aspect.posts.find_all_by_person_id(user.person.id).each do |post|
xml.post post.to_xml if post.respond_to? :to_xml post_doc = post.to_xml
post.comments.each do |comment|
post_doc << comment.to_xml
end
xml.post post_doc
end end
} }
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter