Fix account and tag searches with leading/trailing spaces (#5965)
* Strip leading & trailing spaces from account query * Strip leading & trailing spaces from tag search
This commit is contained in:
committed by
Eugen Rochko
parent
98aa96b8d6
commit
6a82939adb
@ -23,7 +23,7 @@ class Tag < ApplicationRecord
|
||||
|
||||
class << self
|
||||
def search_for(term, limit = 5)
|
||||
pattern = sanitize_sql_like(term) + '%'
|
||||
pattern = sanitize_sql_like(term.strip) + '%'
|
||||
Tag.where('lower(name) like lower(?)', pattern).order(:name).limit(limit)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user