don't bother searching if term is empty

staging
multiple creatures 2019-08-15 11:12:17 -05:00
parent bbb025be69
commit 18e727efdf
1 changed files with 1 additions and 0 deletions

View File

@ -345,6 +345,7 @@ class Status < ApplicationRecord
else
scope = Status
end
return none if term.blank?
pattern = sanitize_sql_like(term)
pattern = "#{pattern}"
scope = scope.without_reblogs.where("tsv @@ plainto_tsquery('english', ?)", pattern)