From 24b02c42fd2a187d3762035d19af40100da4b7e8 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 12 Apr 2025 10:59:59 +0200 Subject: [PATCH] Comments are dependents of messages, so need to destroy the latter to get the former --- app/controllers/cards/comments_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/cards/comments_controller.rb b/app/controllers/cards/comments_controller.rb index 6c87e89c7..9588646c2 100644 --- a/app/controllers/cards/comments_controller.rb +++ b/app/controllers/cards/comments_controller.rb @@ -19,13 +19,14 @@ class Cards::CommentsController < ApplicationController end def destroy - @comment.destroy + @message.destroy redirect_to @card end private def set_comment @comment = @card.comments.find(params[:id]) + @message = @comment.message end def ensure_creatorship