Ensure that a "reconsidered" card gets an updated timestamp

so that it's not closed by the subsequent Card::AutoCloseAllDueJob

ref: https://37s.fizzy.37signals.com/collections/693169850/cards/999009030
This commit is contained in:
Mike Dalessio
2025-05-07 16:16:13 -04:00
parent 8fc077b181
commit 4e815fc423
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -49,6 +49,7 @@ module Card::Engageable
transaction do
reopen
engagement&.destroy
touch(:last_active_at)
end
end
end
+3
View File
@@ -48,6 +48,8 @@ class Card::EngageableTest < ActiveSupport::TestCase
end
test "auto_reconsider_all_stagnated" do
travel_to Time.current
cards(:logo, :shipping).each(&:engage)
cards(:logo).update!(last_active_at: 1.day.ago - Card::Engageable::STAGNATED_AFTER)
@@ -59,5 +61,6 @@ class Card::EngageableTest < ActiveSupport::TestCase
assert cards(:shipping).reload.doing?
assert cards(:logo).reload.considering?
assert_equal Time.current, cards(:logo).last_active_at
end
end