@@ -21,7 +21,11 @@ class Note < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def body_matches(query)
|
||||
where("body_index @@ plainto_tsquery(E?)", query.to_escaped_for_tsquery_split)
|
||||
if query =~ /\*/ && CurrentUser.user.is_builder?
|
||||
where("body ILIKE ? ESCAPE E'\\\\'", query.to_escaped_for_sql_like)
|
||||
else
|
||||
where("body_index @@ plainto_tsquery(E?)", query.to_escaped_for_tsquery_split)
|
||||
end
|
||||
end
|
||||
|
||||
def post_tags_match(query)
|
||||
|
||||
Reference in New Issue
Block a user