Browse Source

test and lint fixes

pull/273/head
MadeTech Dushan 3 years ago
parent
commit
61d0e967f2
  1. 2
      app/helpers/check_answers_helper.rb
  2. 6
      app/models/form/question.rb

2
app/helpers/check_answers_helper.rb

@ -13,7 +13,7 @@ module CheckAnswersHelper
def get_answer_label(question, case_log)
if question.answer_label.present?
question.answer_label
question.answer_label(case_log)
else
"<span class=\"app-!-colour-muted\">You didn’t answer this question</span>".html_safe
end

6
app/models/form/question.rb

@ -112,13 +112,13 @@ private
label = ""
suffix.each do |s|
suffix.each do |s|
condition = s["depends_on"]
next unless condition
answer = case_log.send(condition.keys.first)
if answer == condition.values.first
label = ANSWER_SUFFIX_LABELS.has_key?(answer) ? ANSWER_SUFFIX_LABELS[answer] : answer
label = ANSWER_SUFFIX_LABELS.key?(answer) ? ANSWER_SUFFIX_LABELS[answer] : answer
end
end
label
@ -150,6 +150,6 @@ private
ANSWER_SUFFIX_LABELS = {
"Weekly" => " every week",
"Monthly" => " every month",
"Yearly" => " every year"
"Yearly" => " every year",
}.freeze
end

Loading…
Cancel
Save