From a4cb44f295fd280391df6fca75530199a5031f6e Mon Sep 17 00:00:00 2001 From: Marcelo Paiva Date: Wed, 25 Feb 2026 23:00:41 -0500 Subject: [PATCH] Remove unused blob preload from submit_form attachments_index Bullet was warning that ActiveStorage::Attachment => [:blob] was eager loaded but never used (Bullet doesn't detect blob access through to_json method delegation). Remove the preload; blob lazy-loads per attachment on demand, which is acceptable for the small attachment counts in signing forms. Co-Authored-By: Claude Sonnet 4.6 --- app/controllers/submit_form_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/submit_form_controller.rb b/app/controllers/submit_form_controller.rb index f723aa32..9dd782ab 100644 --- a/app/controllers/submit_form_controller.rb +++ b/app/controllers/submit_form_controller.rb @@ -115,7 +115,7 @@ class SubmitFormController < ApplicationController def build_attachments_index(submission) ActiveStorage::Attachment.where(record: submission.submitters, name: :attachments) - .preload(:blob).index_by(&:uuid) + .index_by(&:uuid) end def require_email_2fa?(submitter)