UX: Exclude child catgegories of muted category in similar to search (#19414)

Follow-up to 207b764ea37f13469db1117c5c1102ace05fd2f9
This commit is contained in:
Alan Guo Xiang Tan
2022-12-12 06:31:46 +08:00
committed by GitHub
parent c9197cf9d8
commit 332ac0f299
2 changed files with 12 additions and 1 deletions

View File

@ -642,7 +642,7 @@ class Topic < ActiveRecord::Base
excluded_category_ids_sql = <<~SQL
#{excluded_category_ids_sql}
UNION
#{CategoryUser.where(notification_level: CategoryUser.notification_levels[:muted], user: user).select(:category_id).to_sql}
#{CategoryUser.muted_category_ids_query(user, include_direct: true).select("categories.id").to_sql}
SQL
end