Remove a bunch of N+1s

related to notification and comment rendering
This commit is contained in:
Mike Dalessio
2025-11-27 11:08:45 -05:00
parent b78977f563
commit 79c9ea2ce1
8 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ class CardTest < ActiveSupport::TestCase
assert_difference({ -> { cards(:logo).assignees.count } => -1, -> { Event.count } => +1 }) do
cards(:logo).toggle_assignment users(:kevin)
end
assert_not cards(:logo).assigned_to?(users(:kevin))
assert_not cards(:logo).reload.assigned_to?(users(:kevin))
unassign_event = Event.last
assert_equal "card_unassigned", unassign_event.action
assert_equal [ users(:kevin) ], unassign_event.assignees