Fix #1898: Include alias predicates in non-empty Tags search.

Make searches on the /tags index includes aliases too. Show matching
aliases like this:

   Name: gray*

   ? 75098 grey_hair <- gray_hair
   ? 35345 grey_eyes <- gray_eyes
This commit is contained in:
evazion
2020-02-23 00:20:09 -06:00
parent a8e5412d9c
commit a181e6d0db
5 changed files with 26 additions and 1 deletions

View File

@@ -31,6 +31,11 @@ module Danbooru
def falsy?
self.match?(/\A(false|f|no|n|off|0)\z/i)
end
def ilike?(pattern)
pattern = Regexp.escape(pattern).gsub(/\\\*/, ".*")
match?(/\A#{pattern}\z/i)
end
end
end
end