add template access
This commit is contained in:
@@ -57,6 +57,8 @@ class Submission < ApplicationRecord
|
||||
|
||||
has_many_attached :preview_documents
|
||||
|
||||
has_many :template_accesses, primary_key: :template_id, foreign_key: :template_id, dependent: nil, inverse_of: false
|
||||
|
||||
has_many :template_schema_documents,
|
||||
->(e) { where(uuid: (e.template_schema.presence || e.template.schema).pluck('attachment_uuid')) },
|
||||
through: :template, source: :documents_attachments
|
||||
|
||||
Reference in New Issue
Block a user