fix document metadata

This commit is contained in:
Pete Matsyburka committed 2026-09-30 12:57:48 +03:00
1 parent 4190544edc
commit ce9ab691ec
1 file changed
+2 -2
@@ -17,12 +17,12 @@ class SubmitFormMetadataController < ApplicationController
submission.schema_documents.find { |a| a.uuid == item['attachment_uuid'] }
end
ActiveRecord::Associations::Preloader.new(records: documents, associations: %i[blob record]).call
ActiveRecord::Associations::Preloader.new(records: documents, associations: :blob).call
text_runs = documents.to_h do |document|
[
document.uuid,
DocumentMetadatas.find_or_create_for_document(document, account_id: document.record.account_id).text_runs
DocumentMetadatas.find_or_create_for_document(document, account_id: submission.account_id).text_runs
]
end