10 changed files with 71 additions and 32 deletions
@ -1,13 +1,21 @@
|
||||
class Form::Sales::Pages::Savings < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "savings" |
||||
def initialize(id, hsh, subsection, joint_purchase:) |
||||
super(id, hsh, subsection) |
||||
@joint_purchase = joint_purchase |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::SavingsNk.new(nil, nil, self), |
||||
Form::Sales::Questions::Savings.new(nil, nil, self), |
||||
Form::Sales::Questions::SavingsNk.new(nil, nil, self, joint_purchase: @joint_purchase), |
||||
Form::Sales::Questions::Savings.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 |
||||
|
||||
Loading…
Reference in new issue