diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-08-15 11:12:17 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-08-15 11:12:17 -0500 |
commit | 18e727efdfaf4972168caabbf83fa125ba201711 (patch) | |
tree | 1915d1432c2a10968797764548bdea06744843cd /app | |
parent | bbb025be691cb32f56c97ae42e72f40b99c6be9c (diff) |
don't bother searching if term is empty
Diffstat (limited to 'app')
-rw-r--r-- | app/models/status.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/status.rb b/app/models/status.rb index 8df4ab100..ff37f2bd8 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -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) |