refactored tsquery sql to use rails escaping mechanisms

This commit is contained in:
albert
2013-03-07 16:34:12 -05:00
parent b7a5612c82
commit 2338f004eb
10 changed files with 23 additions and 21 deletions

View File

@@ -938,8 +938,7 @@ class Post < ActiveRecord::Base
end
def raw_tag_match(tag)
tag = PostQueryBuilder.escape_string_for_tsquery(tag)
where("posts.tag_index @@ to_tsquery('danbooru', E'" + tag + "')")
where("posts.tag_index @@ to_tsquery('danbooru', E?)", tag.to_escaped_for_tsquery)
end
def tag_match(query)