From 1e640643e9226320920d707891200c607cf44f65 Mon Sep 17 00:00:00 2001 From: Rosa Gutierrez Date: Fri, 19 Dec 2025 11:16:20 +0100 Subject: [PATCH] Remove unused `tag_ids` parameter from `CardsController#update` This is no longer used in the normal flow of the app. The tags are added via `Cards::TaggingsController`. --- app/controllers/cards_controller.rb | 2 +- test/controllers/cards_controller_test.rb | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/controllers/cards_controller.rb b/app/controllers/cards_controller.rb index 83706ddf4..bfdc1ee2e 100644 --- a/app/controllers/cards_controller.rb +++ b/app/controllers/cards_controller.rb @@ -61,6 +61,6 @@ class CardsController < ApplicationController end def card_params - params.expect(card: [ :status, :title, :description, :image, :created_at, :last_active_at, tag_ids: [] ]) + params.expect(card: [ :status, :title, :description, :image, :created_at, :last_active_at ]) end end diff --git a/test/controllers/cards_controller_test.rb b/test/controllers/cards_controller_test.rb index c6c56fc83..d13affa96 100644 --- a/test/controllers/cards_controller_test.rb +++ b/test/controllers/cards_controller_test.rb @@ -50,15 +50,12 @@ class CardsControllerTest < ActionDispatch::IntegrationTest card: { title: "Logo needs to change", image: fixture_file_upload("moon.jpg", "image/jpeg"), - description: "Something more in-depth", - tag_ids: [ tags(:mobile).id ] } } + description: "Something more in-depth" } } assert_response :success card = cards(:logo).reload assert_equal "Logo needs to change", card.title assert_equal "moon.jpg", card.image.filename.to_s - assert_equal [ tags(:mobile) ], card.tags - assert_equal "Something more in-depth", card.description.to_plain_text.strip end @@ -152,7 +149,7 @@ class CardsControllerTest < ActionDispatch::IntegrationTest test "create as JSON" do assert_difference -> { Card.count }, +1 do post board_cards_path(boards(:writebook)), - params: { card: { title: "My new card", description: "Big if true", tag_ids: [ tags(:web).id, tags(:mobile).id ] } }, + params: { card: { title: "My new card", description: "Big if true" } }, as: :json assert_response :created end @@ -162,7 +159,6 @@ class CardsControllerTest < ActionDispatch::IntegrationTest assert_equal "My new card", card.title assert_equal "Big if true", card.description.to_plain_text - assert_equal [ tags(:mobile), tags(:web) ].sort, card.tags.sort end test "create as JSON with custom created_at" do