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 <noreply@anthropic.com>
pull/599/head
Marcelo Paiva 3 weeks ago
parent 31b745e972
commit a4cb44f295

@ -115,7 +115,7 @@ class SubmitFormController < ApplicationController
def build_attachments_index(submission) def build_attachments_index(submission)
ActiveStorage::Attachment.where(record: submission.submitters, name: :attachments) ActiveStorage::Attachment.where(record: submission.submitters, name: :attachments)
.preload(:blob).index_by(&:uuid) .index_by(&:uuid)
end end
def require_email_2fa?(submitter) def require_email_2fa?(submitter)

Loading…
Cancel
Save