fix start form
This commit is contained in:
@@ -12,7 +12,7 @@ class StartFormController < ApplicationController
|
||||
end
|
||||
|
||||
def update
|
||||
@submitter = Submitter.where(submission: @template.submissions.where(submission: { deleted_at: nil }))
|
||||
@submitter = Submitter.where(submission: @template.submissions.where(deleted_at: nil))
|
||||
.find_or_initialize_by(**submitter_params)
|
||||
|
||||
if @submitter.completed_at?
|
||||
|
||||
@@ -34,7 +34,7 @@ module Submissions
|
||||
|
||||
case field['type']
|
||||
when 'image', 'signature'
|
||||
attachment = submission.attachments.find { |a| a.uuid == value }
|
||||
attachment = submitter.attachments.find { |a| a.uuid == value }
|
||||
io = StringIO.new(attachment.download)
|
||||
|
||||
Vips::Image.new_from_buffer(io.read, '')
|
||||
@@ -49,7 +49,7 @@ module Submissions
|
||||
height: attachment.metadata['height'] * scale)
|
||||
when 'file'
|
||||
Array.wrap(value).each_with_index do |uuid, index|
|
||||
attachment = submission.attachments.find { |a| a.uuid == uuid }
|
||||
attachment = submitter.attachments.find { |a| a.uuid == uuid }
|
||||
|
||||
canvas.image(PdfIcons.paperclip_io,
|
||||
at: [area['x'] * width,
|
||||
|
||||
@@ -6,6 +6,7 @@ module.exports = {
|
||||
'./app/javascript/submission_form/**/*.vue',
|
||||
'./app/views/submit_form/**/*.erb',
|
||||
'./app/views/start_form/**/*.erb',
|
||||
'./app/views/shared/_button_title.html.erb',
|
||||
'./app/views/send_submission_copy/**/*.erb'
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user