FIX: tag search should not be case sensitive

This commit is contained in:
Neil Lalonde
2016-09-09 16:55:26 -04:00
parent e78b7a243e
commit b381d84dd9
2 changed files with 2 additions and 1 deletions

View File

@@ -56,6 +56,7 @@ module DiscourseTagging
def self.filter_allowed_tags(query, guardian, opts={})
term = opts[:term]
if term.present?
term.downcase!
term.gsub!(/[^a-z0-9\.\-\_]*/, '')
term.gsub!("_", "\\_")
query = query.where('tags.name like ?', "%#{term}%")