Browse Source
* add validation for declaration on log submission * Only present next incomplete section link if such section existspull/281/head
kosiakkatrina
3 years ago
committed by
GitHub
26 changed files with 133 additions and 179 deletions
@ -0,0 +1,10 @@
|
||||
module Validations::SubmissionValidations |
||||
# Validations methods need to be called 'validate_<page_name>' to run on model save |
||||
# or 'validate_' to run on submit as well |
||||
|
||||
def validate_declaration(record) |
||||
if record.declaration == "No" |
||||
record.errors.add :declaration, I18n.t("validations.declaration.missing") |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,7 @@
|
||||
class AddDeclaration < ActiveRecord::Migration[7.0] |
||||
def change |
||||
change_table :case_logs, bulk: true do |t| |
||||
t.column :declaration, :integer |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,15 @@
|
||||
class RemoveGdprFields < ActiveRecord::Migration[7.0] |
||||
def up |
||||
change_table :case_logs, bulk: true do |t| |
||||
t.remove :gdpr_declined |
||||
t.remove :gdpr_acceptance |
||||
end |
||||
end |
||||
|
||||
def down |
||||
change_table :case_logs, bulk: true do |t| |
||||
t.column :gdpr_declined, :string |
||||
t.column :gdpr_acceptance, :string |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue