]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/api/changesets/_changeset.xml.builder
Merge remote-tracking branch 'upstream/pull/5702'
[rails.git] / app / views / api / changesets / _changeset.xml.builder
index e0188a10e0914b5e9dd66fbd756c8a426df38e2f..072f8fc5d613fc26b011b4b3b4b17ab9a2598c21 100644 (file)
@@ -24,19 +24,10 @@ xml.changeset(attrs) do |changeset_xml_node|
 
   # include discussion if requested
 
-  if @include_discussion
+  if @comments
     changeset_xml_node.discussion do |discussion_xml_node|
-      changeset.comments.includes(:author).each do |comment|
-        cattrs = {
-          "date" => comment.created_at.xmlschema
-        }
-        if comment.author.data_public?
-          cattrs["uid"] = comment.author.id
-          cattrs["user"] = comment.author.display_name
-        end
-        discussion_xml_node.comment(cattrs) do |comment_xml_node|
-          comment_xml_node.text(comment.body)
-        end
+      @comments.each do |comment|
+        discussion_xml_node << render(comment)
       end
     end
   end