X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/413baecf6b27056cb73e6bb4bedb33de6410c65e..8db05481193bfb105c76cda40ea0617b5f10545e:/lib/object_metadata.rb diff --git a/lib/object_metadata.rb b/lib/object_metadata.rb index d4d0bcfc7..c765df526 100644 --- a/lib/object_metadata.rb +++ b/lib/object_metadata.rb @@ -1,10 +1,10 @@ module ObjectMetadata def add_metadata_to_xml_node(el, osm, changeset_cache, user_display_name_cache) - el['changeset'] = osm.changeset_id.to_s - el['redacted'] = osm.redaction.id.to_s if osm.redacted? - el['timestamp'] = osm.timestamp.xmlschema - el['version'] = osm.version.to_s - el['visible'] = osm.visible.to_s + el["changeset"] = osm.changeset_id.to_s + el["redacted"] = osm.redaction.id.to_s if osm.redacted? + el["timestamp"] = osm.timestamp.xmlschema + el["version"] = osm.version.to_s + el["visible"] = osm.visible.to_s if changeset_cache.key?(osm.changeset_id) # use the cache if available @@ -23,8 +23,19 @@ module ObjectMetadata end unless user_display_name_cache[user_id].nil? - el['user'] = user_display_name_cache[user_id] - el['uid'] = user_id.to_s + el["user"] = user_display_name_cache[user_id] + el["uid"] = user_id.to_s + end + end + + def add_tags_to_xml_node(el, tags) + tags.each do |tag| + tag_el = XML::Node.new("tag") + + tag_el["k"] = tag.k + tag_el["v"] = tag.v + + el << tag_el end end end