Make sure we don't inherit old tags when parsing XML for objects

This commit is contained in:
Tom Hughes 2012-02-13 10:29:03 +00:00
parent 5a8c4faf3e
commit 92feab9112
3 changed files with 12 additions and 0 deletions

View file

@ -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?