This commit is contained in:
albert
2012-02-20 14:51:15 -05:00
parent 608f390eef
commit 1acdc961c7

View File

@@ -2,7 +2,7 @@ class Tag < ActiveRecord::Base
attr_accessible :category
after_save :update_category_cache
has_one :wiki_page, :foreign_key => "name", :primary_key => "title"
scope :name_matches, lambda {|name| where("name LIKE ? ESCAPE E'\\\\'", name.to_escaped_for_sql_like)}
scope :name_matches, lambda {|name| where("name LIKE ? ESCAPE E'\\\\'", name.downcase.to_escaped_for_sql_like)}
scope :named, lambda {|name| where("name = ?", TagAlias.to_aliased([name]).join(""))}
search_methods :name_matches