Make sure we don't inherit old tags when parsing XML for objects
This commit is contained in:
parent
5a8c4faf3e
commit
92feab9112
3 changed files with 12 additions and 0 deletions
|
@ -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?
|
||||
|
|
|
@ -66,6 +66,10 @@ class Relation < ActiveRecord::Base
|
|||
# and manually set to false before the actual delete.
|
||||
relation.visible = true
|
||||
|
||||
# Start with no tags
|
||||
relation.tags = Hash.new
|
||||
|
||||
# Add in any tags from the XML
|
||||
pt.find('tag').each do |tag|
|
||||
raise OSM::APIBadXMLError.new("relation", pt, "tag is missing key") if tag['k'].nil?
|
||||
raise OSM::APIBadXMLError.new("relation", pt, "tag is missing value") if tag['v'].nil?
|
||||
|
|
|
@ -64,6 +64,10 @@ class Way < ActiveRecord::Base
|
|||
# and manually set to false before the actual delete.
|
||||
way.visible = true
|
||||
|
||||
# Start with no tags
|
||||
way.tags = Hash.new
|
||||
|
||||
# Add in any tags from the XML
|
||||
pt.find('tag').each do |tag|
|
||||
raise OSM::APIBadXMLError.new("way", pt, "tag is missing key") if tag['k'].nil?
|
||||
raise OSM::APIBadXMLError.new("way", pt, "tag is missing value") if tag['v'].nil?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue