After touch should trigger board touch too

The change in https://github.com/basecamp/fizzy/commit/c606de7b41f57734c4c859c5fc3d98c952b26d58#diff-1ecde9fb1ee2494e5d94e807f51f861928f77cfcfb0884889911b62a32c2ff4cL4-R23 was preventing marking cards as golden from broadcasting
This commit is contained in:
Jorge Manrubia
2025-12-02 05:52:07 +01:00
parent 7f9e5b0903
commit af0113c9ee
2 changed files with 16 additions and 0 deletions
+1
View File
@@ -16,6 +16,7 @@ class Card < ApplicationRecord
before_create :assign_number
after_save -> { board.touch }, if: :published?
after_touch -> { board.touch }, if: :published?
after_update :handle_board_change, if: :saved_change_to_board_id?
scope :reverse_chronologically, -> { order created_at: :desc, id: :desc }
+15
View File
@@ -24,4 +24,19 @@ class Card::GoldenTest < ActiveSupport::TestCase
assert_includes Card.golden, cards(:logo)
assert_not_includes Card.golden, cards(:text)
end
test "gilding a card touches both the card and the board" do
card = cards(:text)
board = card.board
card_updated_at = card.updated_at
board_updated_at = board.updated_at
travel 1.minute do
card.gild
end
assert card.reload.updated_at > card_updated_at
assert board.reload.updated_at > board_updated_at
end
end