@ -20,8 +20,10 @@ class CaseLogValidator < ActiveModel::Validator
def validate(record)
question_to_validate = options[:previous_page]
if question_to_validate.present?
public_send("validate_#{question_to_validate}", record)
end
class CaseLog < ApplicationRecord