0
0
Fork 0

Make tag search case insensitive again (#4184)

This commit is contained in:
unarist 2017-07-14 02:31:33 +09:00 committed by Eugen Rochko
parent c29c20ab3c
commit c2753fdfb4
4 changed files with 23 additions and 3 deletions

View file

@ -23,7 +23,7 @@ class Tag < ApplicationRecord
class << self
def search_for(term, limit = 5)
pattern = sanitize_sql_like(term) + '%'
Tag.where('name like ?', pattern).order(:name).limit(limit)
Tag.where('lower(name) like lower(?)', pattern).order(:name).limit(limit)
end
end
end