]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_relation_tag.rb
Cope with MESSAGES_DOMAIN not being defined
[rails.git] / app / models / old_relation_tag.rb
index 6ad4b452e4ed50790a340cd4c60a5eb35eb87d10..0fcb113269ea475fef4438d747ccee8eb9c69e26 100644 (file)
@@ -1,6 +1,10 @@
 class OldRelationTag < ActiveRecord::Base
 class OldRelationTag < ActiveRecord::Base
-  belongs_to :user
-
   set_table_name 'relation_tags'
   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
 end