]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_node_tag.rb
Updated this using the en.yml file in the ruby.git distribution for reference
[rails.git] / app / models / old_node_tag.rb
index 26a6c92b490f52220ce1b60f068a4b800b2071b5..dd339ad307b6400d1fed177cea4020c89883a4b2 100644 (file)
@@ -1,7 +1,10 @@
 class OldNodeTag < ActiveRecord::Base
-  belongs_to :user
-
   set_table_name 'node_tags'
 
+  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