mirror of https://github.com/docusealco/docuseal
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
446 B
15 lines
446 B
# frozen_string_literal: true
|
|
|
|
module Submitters
|
|
module_function
|
|
|
|
def select_attachments_for_download(submitter)
|
|
original_documents = submitter.submission.template.documents.preload(:blob)
|
|
is_more_than_two_images = original_documents.count(&:image?) > 1
|
|
|
|
submitter.documents.preload(:blob).reject do |attachment|
|
|
is_more_than_two_images && original_documents.find { |a| a.uuid == attachment.uuid }&.image?
|
|
end
|
|
end
|
|
end
|