X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/cfbdd3f7e1c688e2c875ded9fd847fcc1c3a4caf..b823e9fccca6072d92cc4f1ba0d1850488a5f3c4:/app/models/relation_tag.rb diff --git a/app/models/relation_tag.rb b/app/models/relation_tag.rb index 939165ebd..812b2ec35 100644 --- a/app/models/relation_tag.rb +++ b/app/models/relation_tag.rb @@ -3,4 +3,8 @@ class RelationTag < ActiveRecord::Base belongs_to :relation, :foreign_key => 'id' + validates_presence_of :id + validates_length_of :k, :v, :maximum => 255, :allow_blank => true + validates_uniqueness_of :id, :scope => :k + validates_numericality_of :id, :only_integer => true end