diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 3ba2ca844..323af4574 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -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 diff --git a/app/models/tag.rb b/app/models/tag.rb index 488a8fa9b..b283e42ee 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -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?