Fix: extract mentions when publishing cards

This wasn't working when creation and publishing happened on separated instances
of the same record, which is what happens when you edit a draft and then you
publish it

https://app.fizzy.do/5986089/cards/2835/edit
This commit is contained in:
Jorge Manrubia
2025-11-10 13:08:29 +01:00
parent 63291ca0a2
commit b686936230
3 changed files with 13 additions and 1 deletions
+4
View File
@@ -20,6 +20,8 @@ class MentionsTest < ActiveSupport::TestCase
boards(:writebook).cards.create title: "Cleanup", description: "Did you finish up with the cleanup, @david?"
end
card = Card.find(card.id)
assert_difference -> { Mention.count }, +1 do
card.published!
end
@@ -33,6 +35,8 @@ class MentionsTest < ActiveSupport::TestCase
boards(:writebook).cards.create title: "Cleanup", description: "Did you finish up with the cleanup, #{attachment.to_html}?"
end
card = Card.find(card.id)
assert_difference -> { Mention.count }, +1 do
card.published!
end