]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/node.rb
Make sure we don't inherit old tags when parsing XML for objects
[rails.git] / app / models / node.rb
index 0f176067d75e8aeb218c51ae8eaf3258f36a0e81..53787245916d5c60bca1e16060e17cd0183791e2 100644 (file)
@@ -4,7 +4,7 @@ class Node < ActiveRecord::Base
   include GeoRecord
   include ConsistencyValidations
 
-  set_table_name 'current_nodes'
+  self.table_name = "current_nodes"
 
   belongs_to :changeset
 
@@ -106,6 +106,10 @@ class Node < ActiveRecord::Base
     # and set manually before the actual delete
     node.visible = true
 
+    # Start with no tags
+    node.tags = Hash.new
+
+    # Add in any tags from the XML
     pt.find('tag').each do |tag|
       raise OSM::APIBadXMLError.new("node", pt, "tag is missing key") if tag['k'].nil?
       raise OSM::APIBadXMLError.new("node", pt, "tag is missing value") if tag['v'].nil?