mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Expand coverage for Tag.search_for method (#38405)
This commit is contained in:
@@ -32,7 +32,7 @@ class Admin::TagFilter
|
||||
when :status
|
||||
status_scope(value)
|
||||
when :name
|
||||
Tag.search_for(value.to_s.strip, params[:limit], params[:offset], exclude_unlistable: false)
|
||||
Tag.search_for(value, params[:limit], params[:offset], exclude_unlistable: false)
|
||||
when :order
|
||||
order_scope(value)
|
||||
else
|
||||
|
||||
@@ -128,7 +128,7 @@ class Tag < ApplicationRecord
|
||||
end
|
||||
|
||||
def search_for(term, limit = 5, offset = 0, options = {})
|
||||
stripped_term = term.strip
|
||||
stripped_term = term.to_s.strip
|
||||
options.reverse_merge!({ exclude_unlistable: true, exclude_unreviewed: false })
|
||||
|
||||
query = Tag.matches_name(stripped_term)
|
||||
|
||||
Reference in New Issue
Block a user