Browse Source

Add top_guidance_partial to missed shared ownership questions

pull/2552/head
Kat 2 years ago
parent
commit
63a1a27749
  1. 7
      app/models/form/sales/questions/mortgageused.rb
  2. 1
      app/models/form/sales/questions/staircase_bought.rb

7
app/models/form/sales/questions/mortgageused.rb

@ -8,7 +8,7 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question
@answer_options = ANSWER_OPTIONS
@ownershipsch = ownershipsch
@question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch]
@top_guidance_partial = "financial_calculations_discounted_ownership" if @ownershipsch == 2
@top_guidance_partial = top_guidance_partial
end
def displayed_answer_options(log, _user = nil)
@ -35,4 +35,9 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question
2023 => { 1 => 90, 2 => 103, 3 => 111 },
2024 => { 1 => 91, 2 => 104, 3 => 112 },
}.freeze
def top_guidance_partial
return "financial_calculations_shared_ownership" if @ownershipsch == 1
return "financial_calculations_discounted_ownership" if @ownershipsch == 2
end
end

1
app/models/form/sales/questions/staircase_bought.rb

@ -11,6 +11,7 @@ class Form::Sales::Questions::StaircaseBought < ::Form::Question
@step = 1
@suffix = "%"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@top_guidance_partial = "financial_calculations_shared_ownership"
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 77, 2024 => 79 }.freeze

Loading…
Cancel
Save