5 "created_at" => changeset.created_at.xmlschema,
6 "open" => changeset.is_open?,
7 "comments_count" => changeset.comments.length,
8 "changes_count" => changeset.num_changes
10 attrs["closed_at"] = changeset.closed_at.xmlschema unless changeset.is_open?
11 changeset.bbox.to_unscaled.add_bounds_to(attrs, "_") if changeset.bbox.complete?
15 if changeset.user.data_public?
16 attrs["uid"] = changeset.user_id
17 attrs["user"] = changeset.user.display_name
20 xml.changeset(attrs) do |changeset_xml_node|
21 changeset.tags.each do |k, v|
22 changeset_xml_node.tag(:k => k, :v => v)
25 # include discussion if requested
27 if @include_discussion
28 changeset_xml_node.discussion do |discussion_xml_node|
29 changeset.comments.includes(:author).each do |comment|
31 "date" => comment.created_at.xmlschema
33 if comment.author.data_public?
34 cattrs["uid"] = comment.author.id
35 cattrs["user"] = comment.author.display_name
37 discussion_xml_node.comment(cattrs) do |comment_xml_node|
38 comment_xml_node.text(comment.body)