]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_node_tag.rb
Working around mysql bug...
[rails.git] / app / models / old_node_tag.rb
index 392e3934ed4ada476794b61ddbd0e0a31cea7208..dd339ad307b6400d1fed177cea4020c89883a4b2 100644 (file)
@@ -1,9 +1,10 @@
 class OldNodeTag < ActiveRecord::Base
 class OldNodeTag < ActiveRecord::Base
-  belongs_to :user
-
   set_table_name 'node_tags'
 
   set_table_name 'node_tags'
 
+  belongs_to :user
+
   validates_presence_of :id, :version
   validates_length_of :k, :v, :maximum => 255, :allow_blank => true
   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
 end