add documents preview endpoint

This commit is contained in:
Pete Matsyburka
2024-10-15 19:16:09 +03:00
parent d9f314898b
commit 3ee41975fd
5 changed files with 167 additions and 21 deletions
+2
View File
@@ -55,6 +55,8 @@ class Submission < ApplicationRecord
has_one_attached :audit_trail
has_one_attached :combined_document
has_many_attached :preview_documents
has_many :template_schema_documents,
->(e) { where(uuid: (e.template_schema.presence || e.template.schema).pluck('attachment_uuid')) },
through: :template, source: :documents_attachments