Make sure we clear the column when moving cards to another collection
Or it will be become not accessible
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user