PERF: Remove unnecessary SQL UNION query when search public channels (#19515)

It is pointless to include DM channels because the query for public
channel search restricts chatable type to `Category`.
This commit is contained in:
Alan Guo Xiang Tan
2022-12-20 07:52:26 +08:00
committed by GitHub
parent e30c5f80d5
commit a176ce2fd0
2 changed files with 3 additions and 2 deletions

View File

@ -421,7 +421,6 @@ after_initialize do
following: false,
limit: 1,
status: :open,
exclude_dm_channels: true
).exists?
end