diff --git a/app/models/form/sales/pages/housing_benefits.rb b/app/models/form/sales/pages/housing_benefits.rb index 34bc338f9..e2b72790f 100644 --- a/app/models/form/sales/pages/housing_benefits.rb +++ b/app/models/form/sales/pages/housing_benefits.rb @@ -2,14 +2,6 @@ class Form::Sales::Pages::HousingBenefits < ::Form::Page def initialize(id, hsh, subsection, joint_purchase:) super(id, hsh, subsection) @joint_purchase = joint_purchase - @depends_on = - [ - if @joint_purchase - { "joint_purchase?" => true } - else - { "not_joint_purchase?" => true } - end, - ] end def questions @@ -17,4 +9,12 @@ class Form::Sales::Pages::HousingBenefits < ::Form::Page Form::Sales::Questions::HousingBenefits.new(nil, nil, self, joint_purchase: @joint_purchase), ] end + + def depends_on + if @joint_purchase + [{ "joint_purchase?" => true }] + else + [{ "not_joint_purchase?" => true }] + end + end end