Jack S
2 years ago
committed by
GitHub
9 changed files with 68 additions and 4 deletions
@ -0,0 +1,15 @@
|
||||
class Form::Sales::Pages::HouseholdWheelchair < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "household_wheelchair" |
||||
@header = "" |
||||
@description = "" |
||||
@subsection = subsection |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::HouseholdWheelchair.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
@ -0,0 +1,17 @@
|
||||
class Form::Sales::Questions::HouseholdWheelchair < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
@id = "wheel" |
||||
@header = "Does anyone in the household use a wheelchair?" |
||||
@type = "radio" |
||||
@answer_options = ANSWER_OPTIONS |
||||
@page = page |
||||
@hint_text = "This can be inside or outside the home" |
||||
end |
||||
|
||||
ANSWER_OPTIONS = { |
||||
"1" => { "value" => "Yes" }, |
||||
"2" => { "value" => "No" }, |
||||
"3" => { "value" => "Don't know" }, |
||||
}.freeze |
||||
end |
@ -0,0 +1,15 @@
|
||||
class Form::Sales::Subsections::HouseholdNeeds < ::Form::Subsection |
||||
def initialize(id, hsh, section) |
||||
super |
||||
@id = "household_needs" |
||||
@label = "Household needs" |
||||
@section = section |
||||
@depends_on = [{ "setup" => "completed" }] |
||||
end |
||||
|
||||
def pages |
||||
@pages ||= [ |
||||
Form::Sales::Pages::HouseholdWheelchair.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
@ -0,0 +1,7 @@
|
||||
class AddWheelToSalesLog < ActiveRecord::Migration[7.0] |
||||
def change |
||||
change_table :sales_logs, bulk: true do |t| |
||||
t.column :wheel, :int |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue