1 class OldRelationTag < ActiveRecord::Base
2 self.table_name = "relation_tags"
3 self.primary_keys = "relation_id", "version", "k"
5 belongs_to :old_relation, :foreign_key => [:relation_id, :version]
7 validates :old_relation, :presence => true, :associated => true
8 validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }
9 validates :k, :uniqueness => { :scope => [:relation_id, :version] }