X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1a6230fb25f44491156dd20b07a4bfd8a86cca56..7151fa05e4d4f73956d7f9a7ad2db1f5b956a0c0:/app/models/old_node.rb diff --git a/app/models/old_node.rb b/app/models/old_node.rb index 4f10e65a5..a3650173a 100644 --- a/app/models/old_node.rb +++ b/app/models/old_node.rb @@ -27,8 +27,15 @@ class OldNode < GeoRecord old_node.timestamp = node.timestamp old_node.user_id = node.user_id old_node.id = node.id + old_node.version = node.version return old_node end + + def to_xml + doc = OSM::API.new.get_xml_doc + doc.root << to_xml_node() + return doc + end def to_xml_node el1 = XML::Node.new 'node' @@ -46,6 +53,7 @@ class OldNode < GeoRecord el1['visible'] = self.visible.to_s el1['timestamp'] = self.timestamp.xmlschema + el1['version'] = self.version.to_s return el1 end @@ -57,16 +65,13 @@ class OldNode < GeoRecord #ok from here @attributes.update(OldNode.find(:first, :conditions => ['id = ? AND timestamp = ?', self.id, self.timestamp]).instance_variable_get('@attributes')) - sequence_id = 1 self.tags.each do |k,v| tag = OldNodeTag.new tag.k = k tag.v = v tag.id = self.id tag.version = self.version - tag.sequence_id = sequence_id tag.save! - sequence_id += 1 end end