diff options
author | Andrea Scarpino <scarpino@kde.org> | 2017-12-10 19:35:46 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-12-10 19:35:46 +0100 |
commit | 6a82939adb823c9a65829c23dc7109a96480befe (patch) | |
tree | b437f700a99faa7c764f28bd414d0fe08c18c045 /app/models | |
parent | 98aa96b8d6800f049e6b185b15a6c215042b8f08 (diff) |
Fix account and tag searches with leading/trailing spaces (#5965)
* Strip leading & trailing spaces from account query * Strip leading & trailing spaces from tag search
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/tag.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/tag.rb b/app/models/tag.rb index 0fa08e157..dc2c8d129 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -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 |