Browse Source

rubocop

pull/63/head
magicmilo 3 years ago
parent
commit
c6fb2580df
  1. 3
      app/helpers/check_answers_helper.rb
  2. 3
      app/models/case_log.rb

3
app/helpers/check_answers_helper.rb

@ -16,9 +16,6 @@ module CheckAnswersHelper
while page_name.to_s != "check_answers" && subsection_keys.include?(page_name) while page_name.to_s != "check_answers" && subsection_keys.include?(page_name)
questions = form.questions_for_page(page_name) questions = form.questions_for_page(page_name)
question_key = questions.keys[0]
question_value = questions.values[0]
applicable_questions = filter_conditional_questions(questions, case_log) applicable_questions = filter_conditional_questions(questions, case_log)
total_questions = total_questions.merge(applicable_questions) total_questions = total_questions.merge(applicable_questions)

3
app/models/case_log.rb

@ -72,11 +72,12 @@ class CaseLogValidator < ActiveModel::Validator
end end
end end
private private
def women_of_child_bearing_age_in_household(record) def women_of_child_bearing_age_in_household(record)
(1..8).any? do |n| (1..8).any? do |n|
next if record["person_#{n}_gender"].nil? || record["person_#{n}_age"].nil? next if record["person_#{n}_gender"].nil? || record["person_#{n}_age"].nil?
record["person_#{n}_gender"] == "Female" && record["person_#{n}_age"] >= 16 && record["person_#{n}_age"] <= 50 record["person_#{n}_gender"] == "Female" && record["person_#{n}_age"] >= 16 && record["person_#{n}_age"] <= 50
end end
end end

Loading…
Cancel
Save