mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 06:56:01 +08:00
FIX: Delete associated channel upon category deletion
Currently when a category is deleted, if it has an associated chat channel, the latter won’t be deleted automatically. The fix is quite simple as we were simply missing a `dependent: :destroy` option on the existing relation.
This commit is contained in:

committed by
Loïc Guitaut

parent
e9863b145c
commit
01392ab90c
@ -8,7 +8,7 @@ RSpec.describe Category do
|
||||
let(:channel_class) { CategoryChannel }
|
||||
end
|
||||
|
||||
it { is_expected.to have_one(:category_channel) }
|
||||
it { is_expected.to have_one(:category_channel).dependent(:destroy) }
|
||||
|
||||
describe "#cannot_delete_reason" do
|
||||
subject(:reason) { category.cannot_delete_reason }
|
||||
|
Reference in New Issue
Block a user