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
@@ -14,7 +14,7 @@ class Notification < ApplicationRecord
after_destroy_commit :broadcast_read
after_create :bundle
scope :preloaded, -> { preload(:creator, :account, source: [ :board, :creator ]) }
scope :preloaded, -> { preload(:creator, :account, source: [ :board, :creator, { eventable: [ :closure, :board, :assignments ] } ]) }
delegate :notifiable_target, to: :source
delegate :card, to: :source