decline submission
This commit is contained in:
@@ -48,6 +48,7 @@ class SubmissionEvent < ApplicationRecord
|
||||
start_form: 'start_form',
|
||||
view_form: 'view_form',
|
||||
complete_form: 'complete_form',
|
||||
decline_form: 'decline_form',
|
||||
api_complete_form: 'api_complete_form'
|
||||
}, scope: false
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# completed_at :datetime
|
||||
# declined_at :datetime
|
||||
# email :string
|
||||
# ip :string
|
||||
# metadata :text not null
|
||||
@@ -59,7 +60,9 @@ class Submitter < ApplicationRecord
|
||||
scope :completed, -> { where.not(completed_at: nil) }
|
||||
|
||||
def status
|
||||
if completed_at?
|
||||
if declined_at?
|
||||
'declined'
|
||||
elsif completed_at?
|
||||
'completed'
|
||||
elsif opened_at?
|
||||
'opened'
|
||||
@@ -83,6 +86,6 @@ class Submitter < ApplicationRecord
|
||||
end
|
||||
|
||||
def status_event_at
|
||||
completed_at || opened_at || sent_at || created_at
|
||||
declined_at || completed_at || opened_at || sent_at || created_at
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user