Browse Source

Check that we have an inferred check answers value before extracting its value (#933)

It's possible that this method returns true despite not having an `inferred_check_answers_value` set. This is an obvious smell that we will return to fix.
pull/934/head
James Rose 2 years ago committed by GitHub
parent
commit
a136a70139
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/models/form/question.rb

2
app/models/form/question.rb

@ -51,7 +51,7 @@ class Form::Question
answer = label_from_value(log[id]) if log[id].present?
answer_label = [prefix, format_value(answer), suffix_label(log)].join("") if answer
inferred = inferred_check_answers_value["value"] if has_inferred_check_answers_value?(log)
inferred = inferred_check_answers_value["value"] if inferred_check_answers_value && has_inferred_check_answers_value?(log)
return inferred if inferred.present?
answer_label

Loading…
Cancel
Save