X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/3549d8900fae286019f9a4ad89d860e4eda76fb6..cf24a5a3ee68905c5f55cf6f17c5d2ea983cb34f:/app/models/way.rb diff --git a/app/models/way.rb b/app/models/way.rb index 341bc6e3e..90458006e 100644 --- a/app/models/way.rb +++ b/app/models/way.rb @@ -169,6 +169,11 @@ class Way < ActiveRecord::Base def add_tag_keyval(k, v) @tags = Hash.new unless @tags + + # duplicate tags are now forbidden, so we can't allow values + # in the hash to be overwritten. + raise OSM::APIDuplicateTagsError.new if @tags.include? k + @tags[k] = v end @@ -212,7 +217,7 @@ class Way < ActiveRecord::Base if !new_way.preconditions_ok? raise OSM::APIPreconditionFailedError.new end - self.changeset_id = changeset_id + self.changeset_id = new_way.changeset_id self.tags = new_way.tags self.nds = new_way.nds self.visible = true