This commit is contained in:
albert
2013-03-10 16:31:39 -04:00
parent 1946fab809
commit e53d60d99b
22 changed files with 384 additions and 17 deletions

View File

@@ -4,10 +4,11 @@ class TagAlias < ActiveRecord::Base
after_save :ensure_category_consistency
after_destroy :clear_all_cache
before_validation :initialize_creator, :on => :create
validates_presence_of :creator_id
validates_presence_of :creator_id, :antecedent_name, :consequent_name
validates_uniqueness_of :antecedent_name
validate :absence_of_transitive_relation
belongs_to :creator, :class_name => "User"
belongs_to :forum_topic
module SearchMethods
def name_matches(name)

View File

@@ -3,7 +3,7 @@ class TagImplication < ActiveRecord::Base
after_save :update_descendant_names_for_parent
belongs_to :creator, :class_name => "User"
before_validation :initialize_creator, :on => :create
validates_presence_of :creator_id
validates_presence_of :creator_id, :antecedent_name, :consequent_name
validates_uniqueness_of :antecedent_name, :scope => :consequent_name
validate :absence_of_circular_relation