mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Allow deletion of categories when chat channel is not present
Currently it’s not possible to delete a category if an associated chat channel is present even if there are no messages in this channel. This can lead to annoying situations for our users. This patch addresses the issue by checking if the channel is empty instead of just checking if there is a channel.
This commit is contained in:
committed by
Loïc Guitaut
parent
b9d4336a20
commit
9c482a645c
@@ -14,6 +14,7 @@ RSpec.shared_examples "a chat channel model" do
|
||||
it { is_expected.to have_many(:chat_messages) }
|
||||
it { is_expected.to have_many(:user_chat_channel_memberships) }
|
||||
it { is_expected.to have_one(:chat_channel_archive) }
|
||||
it { is_expected.to delegate_method(:empty?).to(:chat_messages).with_prefix }
|
||||
it do
|
||||
is_expected.to define_enum_for(:status).with_values(
|
||||
open: 0,
|
||||
|
||||
Reference in New Issue
Block a user