Skip to content

Commit 2ba7edb

Browse files
Remove n+1 for Active Storage attachments (#461)
1 parent f0f2095 commit 2ba7edb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/models/maintenance_tasks/task_data.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def find(name)
4040
def available_tasks
4141
task_names = Task.available_tasks.map(&:name)
4242
available_task_runs = Run.where(task_name: task_names)
43-
last_runs = Run.where(
43+
last_runs = Run.with_attached_csv.where(
4444
id: available_task_runs.select("MAX(id) as id").group(:task_name)
4545
)
4646

0 commit comments

Comments
 (0)