fix start form

This commit is contained in:
Alex Turchyn
2023-06-14 02:08:26 +03:00
parent b6bb10b45c
commit 992706144b
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ class StartFormController < ApplicationController
end end
def update 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) .find_or_initialize_by(**submitter_params)
if @submitter.completed_at? if @submitter.completed_at?
@@ -34,7 +34,7 @@ module Submissions
case field['type'] case field['type']
when 'image', 'signature' when 'image', 'signature'
attachment = submission.attachments.find { |a| a.uuid == value } attachment = submitter.attachments.find { |a| a.uuid == value }
io = StringIO.new(attachment.download) io = StringIO.new(attachment.download)
Vips::Image.new_from_buffer(io.read, '') Vips::Image.new_from_buffer(io.read, '')
@@ -49,7 +49,7 @@ module Submissions
height: attachment.metadata['height'] * scale) height: attachment.metadata['height'] * scale)
when 'file' when 'file'
Array.wrap(value).each_with_index do |uuid, index| 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, canvas.image(PdfIcons.paperclip_io,
at: [area['x'] * width, at: [area['x'] * width,
+1
View File
@@ -6,6 +6,7 @@ module.exports = {
'./app/javascript/submission_form/**/*.vue', './app/javascript/submission_form/**/*.vue',
'./app/views/submit_form/**/*.erb', './app/views/submit_form/**/*.erb',
'./app/views/start_form/**/*.erb', './app/views/start_form/**/*.erb',
'./app/views/shared/_button_title.html.erb',
'./app/views/send_submission_copy/**/*.erb' './app/views/send_submission_copy/**/*.erb'
] ]
} }