X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/c273b4b1faa6dd3d8aba3d5556605f683326948a..7331f82bce6ed54959b9550aa110c68e75f58eb0:/app/models/relation.rb diff --git a/app/models/relation.rb b/app/models/relation.rb index 7be027559..95181ef05 100644 --- a/app/models/relation.rb +++ b/app/models/relation.rb @@ -218,6 +218,11 @@ class Relation < ActiveRecord::Base # in the hash to be overwritten. raise OSM::APIDuplicateTagsError.new("relation", self.id, k) if @tags.include? k + # check tag size here, as we don't create a RelationTag object until + # just before we save... + raise OSM::APIBadUserInput.new("Relation #{self.id} has a tag with too long a key, '#{k}'.") if k.length > 255 + raise OSM::APIBadUserInput.new("Relation #{self.id} has a tag with too long a value, '#{k}'='#{v}'.") if v.length > 255 + @tags[k] = v end @@ -310,8 +315,6 @@ class Relation < ActiveRecord::Base end return true - rescue - return false end # Temporary method to match interface to nodes