Merge pull request #3210 from evazion/fix-translated-tags

Fix #3208: Fix translated tag suggestions for Pixiv.
This commit is contained in:
Albert Yi
2017-07-10 16:54:04 -07:00
committed by GitHub
6 changed files with 112 additions and 20 deletions

View File

@@ -787,6 +787,10 @@ class Tag < ApplicationRecord
end
module SearchMethods
def nonempty
where("tags.post_count > 0")
end
def name_matches(name)
where("tags.name LIKE ? ESCAPE E'\\\\'", name.mb_chars.downcase.to_escaped_for_sql_like)
end