X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/9a4ea6bfd09acd76533e29e1d4c22c6037909707..72a3947b1bfc1e0917c37d8356edd5e5f7d39ce0:/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