We have a callback dependency to do this actually

This commit is contained in:
David Heinemeier Hansson
2025-04-12 11:47:08 +02:00
parent 0031ce34ea
commit e8a839d5f6
+1 -2
View File
@@ -19,14 +19,13 @@ class Cards::CommentsController < ApplicationController
end
def destroy
@message.destroy
@comment.destroy
redirect_to @card
end
private
def set_comment
@comment = Comment.belonging_to_card(@card).find(params[:id])
@message = @comment.message
end
def ensure_creatorship