@@ -43,7 +43,11 @@ class ForumTopic < ActiveRecord::Base
|
||||
|
||||
module SearchMethods
|
||||
def title_matches(title)
|
||||
where("text_index @@ plainto_tsquery(E?)", title.to_escaped_for_tsquery_split)
|
||||
if title =~ /\*/ && CurrentUser.user.is_builder?
|
||||
where("title ILIKE ? ESCAPE E'\\\\'", title.to_escaped_for_sql_like)
|
||||
else
|
||||
where("text_index @@ plainto_tsquery(E?)", title.to_escaped_for_tsquery_split)
|
||||
end
|
||||
end
|
||||
|
||||
def active
|
||||
|
||||
Reference in New Issue
Block a user