From a6feca49785a93b16a6593f20cdc3ad7c09ea009 Mon Sep 17 00:00:00 2001 From: Matthew Phelan Date: Mon, 11 Oct 2021 11:44:43 +0100 Subject: [PATCH] previous_page null check --- app/models/case_log.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/case_log.rb b/app/models/case_log.rb index 5e4f99c48..f6bf7639e 100644 --- a/app/models/case_log.rb +++ b/app/models/case_log.rb @@ -20,7 +20,9 @@ class CaseLogValidator < ActiveModel::Validator def validate(record) question_to_validate = options[:previous_page] - public_send("validate_#{question_to_validate}", record) + if question_to_validate.present? + public_send("validate_#{question_to_validate}", record) + end end end