Fix bad query when deleting users (#556)
This commit is contained in:
parent
36fa056d24
commit
3bbfa03114
1 changed files with 1 additions and 1 deletions
|
|
@ -468,7 +468,7 @@ class User < ApplicationRecord
|
|||
return if chat_channels.empty? ||
|
||||
chat_channels.where(channel_type: "direct").empty?
|
||||
empty_dm_channels = chat_channels.where(channel_type: "direct").
|
||||
messages.select { |chat_channel| chat_channel.messages.empty? }
|
||||
select { |chat_channel| chat_channel.messages.empty? }
|
||||
empty_dm_channels.destroy_all
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue