X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/9a4ea6bfd09acd76533e29e1d4c22c6037909707..9acc6d32883435ab9734cd4970b292583075a75d:/app/models/node_tag.rb diff --git a/app/models/node_tag.rb b/app/models/node_tag.rb index de3d0629c..494260112 100644 --- a/app/models/node_tag.rb +++ b/app/models/node_tag.rb @@ -4,5 +4,7 @@ class NodeTag < ActiveRecord::Base belongs_to :node, :foreign_key => 'id' validates_presence_of :id - validates_length_of :k, :v, :within => 0..255, :allow_blank => true + validates_length_of :k, :v, :maximum => 255, :allow_blank => true + validates_uniqueness_of :id, :scope => :k + validates_numericality_of :id, :only_integer => true end