tag_aliases/index: fix tag category search options excluding empty tags.
Fix Tag.search to not filter out empty tags by default. Set the default in the tags controller instead. Fixes various search pages, namely aliases/implications/wiki pages, that rely on Tag.search and that don't expect it to filter tags out by default.
This commit is contained in:
@@ -9,7 +9,7 @@ class TagsController < ApplicationController
|
||||
end
|
||||
|
||||
def index
|
||||
@tags = Tag.paginated_search(params)
|
||||
@tags = Tag.paginated_search(params, hide_empty: true)
|
||||
@tags = @tags.includes(:consequent_aliases) if request.format.html?
|
||||
respond_with(@tags)
|
||||
end
|
||||
|
||||
@@ -847,8 +847,8 @@ class Tag < ApplicationRecord
|
||||
q = q.name_or_alias_matches(params[:name_or_alias_matches])
|
||||
end
|
||||
|
||||
if params[:hide_empty].blank? || params[:hide_empty].to_s.truthy?
|
||||
q = q.where("post_count > 0")
|
||||
if params[:hide_empty].to_s.truthy?
|
||||
q = q.nonempty
|
||||
end
|
||||
|
||||
if params[:has_wiki].to_s.truthy?
|
||||
|
||||
Reference in New Issue
Block a user