From 19c537af64f230134c14a3b21e89740bf62365be Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 12 Apr 2025 13:48:03 +0200 Subject: [PATCH] Inline anemic method --- app/controllers/cards_controller.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/controllers/cards_controller.rb b/app/controllers/cards_controller.rb index 558f13d69..d6fba8376 100644 --- a/app/controllers/cards_controller.rb +++ b/app/controllers/cards_controller.rb @@ -26,7 +26,7 @@ class CardsController < ApplicationController def destroy @card.destroy! - redirect_to cards_path(collection_ids: [ @card.collection ]), notice: deleted_notice + redirect_to cards_path(collection_ids: [ @card.collection ]), notice: ("Card deleted" unless @card.creating?) end def update @@ -50,8 +50,4 @@ class CardsController < ApplicationController def card_params params.expect(card: [ :status, :title, :color, :due_on, :image, :draft_comment, tag_ids: [] ]) end - - def deleted_notice - "Card deleted" unless @card.creating? - end end