]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_node_tag.rb
Use the message title as the subject of notification mails
[rails.git] / app / models / old_node_tag.rb
index ef32a0613f3a9aa08df97d9b13d809c4a6f509a5..dd339ad307b6400d1fed177cea4020c89883a4b2 100644 (file)
@@ -1,9 +1,10 @@
 class OldNodeTag < ActiveRecord::Base
-  belongs_to :user
-
   set_table_name 'node_tags'
 
-  validates_presence_of :id, :version
-  validates_length_of :k, :v, :within => 0..255, :allow_blank => true
+  belongs_to :user
 
+  validates_presence_of :id, :version
+  validates_length_of :k, :v, :maximum => 255, :allow_blank => true
+  validates_uniqueness_of :id, :scope => [:k, :version]
+  validates_numericality_of :id, :version, :only_integer => true
 end