]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_relation_tag.rb
Working around mysql bug...
[rails.git] / app / models / old_relation_tag.rb
index 7ce6f694e633bb2a2110711229b1be8b6886e275..0fcb113269ea475fef4438d747ccee8eb9c69e26 100644 (file)
@@ -1,3 +1,10 @@
 class OldRelationTag < ActiveRecord::Base
   set_table_name 'relation_tags'
+  
+  belongs_to :old_relation, :foreign_key => [:id, :version]
+  
+  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