diff --git a/app/controllers/evaluation/download_documents_controller.rb b/app/controllers/evaluation/download_documents_controller.rb index e335c0964..e1db147b8 100644 --- a/app/controllers/evaluation/download_documents_controller.rb +++ b/app/controllers/evaluation/download_documents_controller.rb @@ -50,7 +50,15 @@ def download_document_data end def update_support_details - Support::EvaluatorsDownloadDocument.upsert({ support_case_upload_document_id: params[:document_id], support_case_id: @download_document.support_case_id, email: current_user.email, has_downloaded_documents: true }, unique_by: :idx_on_email_support_case_id_support_case_upload_do_e4a88327e6) + Support::EvaluatorsDownloadDocument.upsert( + { + support_case_upload_document_id: params[:document_id], + support_case_id: @download_document.support_case_id, + email: current_user.email, + has_downloaded_documents: true, + }, + unique_by: %i[email support_case_id support_case_upload_document_id], + ) end def set_download_document diff --git a/app/controllers/evaluation/tasks_controller.rb b/app/controllers/evaluation/tasks_controller.rb index 2e187f9d9..ecc7d6659 100644 --- a/app/controllers/evaluation/tasks_controller.rb +++ b/app/controllers/evaluation/tasks_controller.rb @@ -39,9 +39,9 @@ def set_uploaded_documents end def download_document_status - @download_document_status = if @documents.count == @downloaded_documents.count && @documents.count.positive? + @download_document_status = if @documents.count == @downloaded_documents.count && @documents.any? "complete" - elsif @documents.count > @downloaded_documents.count && @downloaded_documents.count.positive? + elsif @documents.count > @downloaded_documents.count && @downloaded_documents.any? "in_progress" else "to_do"