X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/69c24009975fa03abf84397335043def82b33901..b7f306a437f1b0d6960cdafb348a5c15366ec53e:/app/models/relation.rb diff --git a/app/models/relation.rb b/app/models/relation.rb index 7be027559..24b139f0d 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