This commit is contained in:
albert
2012-02-20 14:55:09 -05:00
parent 1acdc961c7
commit af8c939f7b
2 changed files with 2 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ class TagAlias < ActiveRecord::Base
validates_uniqueness_of :antecedent_name
validate :absence_of_transitive_relation
belongs_to :creator, :class_name => "User"
scope :name_matches, lambda {|name| where("(antecedent_name = ? or consequent_name = ?)", name, name)}
scope :name_matches, lambda {|name| where("(antecedent_name = ? or consequent_name = ?)", name.downcase, name.downcase)}
search_method :name_matches
def self.to_aliased(names)

View File

@@ -6,7 +6,7 @@ class TagImplication < ActiveRecord::Base
validates_presence_of :creator_id
validates_uniqueness_of :antecedent_name, :scope => :consequent_name
validate :absence_of_circular_relation
scope :name_matches, lambda {|name| where("(antecedent_name = ? or consequent_name = ?)", name, name)}
scope :name_matches, lambda {|name| where("(antecedent_name = ? or consequent_name = ?)", name.downcase, name.downcase)}
search_method :name_matches
module DescendantMethods