Browse Source

Add Other reason for leaving as a conditional question

pull/31/head
baarkerlounger 4 years ago
parent
commit
5fbb050c20
  1. 10
      config/forms/2021_2022.json
  2. 2
      db/migrate/20211005115813_add_conditional_fields_to_case_logs.rb
  3. 2
      db/schema.rb

10
config/forms/2021_2022.json

@ -214,7 +214,7 @@
} }
} }
}, },
"last_settled_home":{ "reason_for_leaving_last_settled_home":{
"header": "Leaving their last settled home", "header": "Leaving their last settled home",
"description": "", "description": "",
"questions":{ "questions":{
@ -257,8 +257,16 @@
"31": "Other", "31": "Other",
"32": "Do not know", "32": "Do not know",
"33": "Prefer not to say" "33": "Prefer not to say"
},
"conditional_for": {
"other_reason_for_leaving_last_settled_home": ["Other"]
} }
}, },
"other_reason_for_leaving_last_settled_home": {
"header": "Please state the reason for leaving last settled home",
"hint_text": "",
"type": "text"
},
"benefit_cap_spare_room_subsidy": { "benefit_cap_spare_room_subsidy": {
"header": "Was the reason for leaving because of the benefit cap or removal of the spare room subsidy?", "header": "Was the reason for leaving because of the benefit cap or removal of the spare room subsidy?",
"hint_text": "", "hint_text": "",

2
db/migrate/20211005115813_add_conditional_fields_to_case_logs.rb

@ -2,6 +2,8 @@ class AddConditionalFieldsToCaseLogs < ActiveRecord::Migration[6.1]
def change def change
change_table :case_logs, bulk: true do |t| change_table :case_logs, bulk: true do |t|
t.column :outstanding_rent_or_charges, :string t.column :outstanding_rent_or_charges, :string
t.column :other_reason_for_leaving_last_settled_home, :string
t.rename :last_settled_home, :reason_for_leaving_last_settled_home
end end
end end
end end

2
db/schema.rb

@ -59,7 +59,7 @@ ActiveRecord::Schema.define(version: 2021_10_05_115813) do
t.string "person_8_gender" t.string "person_8_gender"
t.string "person_8_economic" t.string "person_8_economic"
t.string "homelessness" t.string "homelessness"
t.string "last_settled_home" t.string "reason_for_leaving_last_settled_home"
t.string "benefit_cap_spare_room_subsidy" t.string "benefit_cap_spare_room_subsidy"
t.string "armed_forces_active" t.string "armed_forces_active"
t.string "armed_forces_injured" t.string "armed_forces_injured"

Loading…
Cancel
Save