Preload cards

This commit is contained in:
Stanko K.R.
2025-11-17 11:50:03 +01:00
committed by Mike Dalessio
parent ee85c25672
commit e539754e2c
3 changed files with 5 additions and 2 deletions
+2
View File
@@ -19,6 +19,8 @@ class Card < ApplicationRecord
scope :reverse_chronologically, -> { order created_at: :desc, id: :desc }
scope :chronologically, -> { order created_at: :asc, id: :asc }
scope :latest, -> { order last_active_at: :desc, id: :desc }
scope :with_users, -> { preload(creator: [:avatar_attachment, :account], assignees: [:avatar_attachment, :account]) }
scope :preloaded, -> { with_users.preload(:board, :column, :tags, :steps, :closure, :not_now, :goldness, :activity_spike) }
scope :indexed_by, ->(index) do
case index