From c1936abed9d0873e83f61c52fb20c2c434f31c68 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Thu, 30 Oct 2025 09:24:37 +0100 Subject: [PATCH] Reuse concern --- app/controllers/cards/collections_controller.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/controllers/cards/collections_controller.rb b/app/controllers/cards/collections_controller.rb index 7a9f0b097..7d3ff8b9b 100644 --- a/app/controllers/cards/collections_controller.rb +++ b/app/controllers/cards/collections_controller.rb @@ -1,5 +1,7 @@ class Cards::CollectionsController < ApplicationController - before_action :set_collection, only: %i[ update ] + include CollectionScoped + + skip_before_action :set_collection, only: %i[ edit ] def edit @card = Current.user.accessible_cards.find(params[:card_id]) @@ -11,9 +13,4 @@ class Cards::CollectionsController < ApplicationController @card.move_to(@collection) redirect_to @card end - - private - def set_collection - @collection = Current.user.collections.find(params[:collection_id]) - end end