Make sure we clear the column when moving cards to another collection

Or it will be become not accessible
This commit is contained in:
Jorge Manrubia
2025-10-03 16:19:42 +02:00
parent 72191b3fa8
commit 4daeb2a33b
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -58,6 +58,7 @@ class Card < ApplicationRecord
def handle_collection_change
transaction do
send_back_to_triage
track_collection_change_event
grant_access_to_assignees unless collection.all_access?
end
+8
View File
@@ -129,6 +129,14 @@ class CardTest < ActiveSupport::TestCase
assert_equal "Untitled", card.reload.title
end
test "send back to triage when moved to a new collection" do
cards(:logo).update! column: columns(:writebook_in_progress)
assert_changes -> { cards(:logo).reload.triaged? }, from: true, to: false do
cards(:logo).update! collection: collections(:private)
end
end
test "grants access to assignees when moved to a new collection" do
card = cards(:logo)
assignee = users(:david)