From a8357a1e804c406e2841abc49fd33a006f2a9b9f Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 16 Feb 2022 10:40:42 +0000 Subject: [PATCH] Fix allocation unknown type and depends on for referrals --- app/models/case_log.rb | 1 + config/forms/2021_2022.json | 8 ++++---- ...0220210132254_remove_checkbox_parent_fields.rb | 2 +- ...4400_change_unknown_letting_allocation_type.rb | 15 +++++++++++++++ db/schema.rb | 2 +- 5 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20220216094400_change_unknown_letting_allocation_type.rb diff --git a/app/models/case_log.rb b/app/models/case_log.rb index 620aafe1d..307463a57 100644 --- a/app/models/case_log.rb +++ b/app/models/case_log.rb @@ -100,6 +100,7 @@ class CaseLog < ApplicationRecord enum cbl: POLAR, _suffix: true enum chr: POLAR, _suffix: true enum cap: POLAR, _suffix: true + enum letting_allocation_unknown: POLAR, _suffix: true enum wchair: POLAR2, _suffix: true enum incfreq: INCFREQ, _suffix: true enum benefits: BENEFITS, _suffix: true diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index fcf654d48..42aada98a 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -2095,7 +2095,7 @@ { "managing_organisation.provider_type": "LA", "needstype": "General needs", - "referral": "No" + "renewal": "No" } ] }, @@ -2152,7 +2152,7 @@ { "managing_organisation.provider_type": "PRP", "needstype": "General needs", - "referral": "No" + "renewal": "No" } ] }, @@ -2209,7 +2209,7 @@ { "managing_organisation.provider_type": "LA", "needstype": "Supported housing", - "referral": "No" + "renewal": "No" } ] }, @@ -2269,7 +2269,7 @@ { "managing_organisation.provider_type": "PRP", "needstype": "Supported housing", - "referral": "No" + "renewal": "No" } ] } diff --git a/db/migrate/20220210132254_remove_checkbox_parent_fields.rb b/db/migrate/20220210132254_remove_checkbox_parent_fields.rb index 61ccec22d..a8332308d 100644 --- a/db/migrate/20220210132254_remove_checkbox_parent_fields.rb +++ b/db/migrate/20220210132254_remove_checkbox_parent_fields.rb @@ -11,7 +11,7 @@ class RemoveCheckboxParentFields < ActiveRecord::Migration[7.0] change_table :case_logs, bulk: true do |t| t.column :accessibility_requirements, :string t.column :condition_effects, :string - t.remove :reasonable_preference_reason, :string + t.column :reasonable_preference_reason, :string end end end diff --git a/db/migrate/20220216094400_change_unknown_letting_allocation_type.rb b/db/migrate/20220216094400_change_unknown_letting_allocation_type.rb new file mode 100644 index 000000000..408522a22 --- /dev/null +++ b/db/migrate/20220216094400_change_unknown_letting_allocation_type.rb @@ -0,0 +1,15 @@ +class ChangeUnknownLettingAllocationType < ActiveRecord::Migration[7.0] + def up + change_table :case_logs, bulk: true do |t| + t.remove :letting_allocation_unknown + t.column :letting_allocation_unknown, :integer + end + end + + def down + change_table :case_logs, bulk: true do |t| + t.remove :letting_allocation_unknown + t.column :letting_allocation_unknown, :boolean + end + end +end diff --git a/db/schema.rb b/db/schema.rb index b45d23e7b..e0fee6a27 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -190,7 +190,7 @@ ActiveRecord::Schema[7.0].define(version: 202202071123100) do t.integer "previous_postcode_known" t.integer "previous_la_known" t.boolean "is_previous_la_inferred" - t.boolean "letting_allocation_unknown" + t.integer "letting_allocation_unknown" t.index ["managing_organisation_id"], name: "index_case_logs_on_managing_organisation_id" t.index ["owning_organisation_id"], name: "index_case_logs_on_owning_organisation_id" end