adjust completed action

This commit is contained in:
Pete Matsyburka
2024-04-18 16:45:02 +03:00
parent 48de343948
commit 964b1444a5
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ class SubmitFormController < ApplicationController
end
def completed
@submitter = Submitter.find_by!(slug: params[:submit_form_slug])
@submitter = Submitter.completed.find_by!(slug: params[:submit_form_slug])
end
def success; end
+2
View File
@@ -53,6 +53,8 @@ class Submitter < ApplicationRecord
has_many :document_generation_events, dependent: :destroy
has_many :submission_events, dependent: :destroy
scope :completed, -> { where.not(completed_at: nil) }
def status
if completed_at?
'completed'