diff --git a/app/models/case_log.rb b/app/models/case_log.rb index 7ec3ae1bc..9c17b742f 100644 --- a/app/models/case_log.rb +++ b/app/models/case_log.rb @@ -209,6 +209,10 @@ private dynamically_not_required << "fixed_term_tenancy" end + if tenancy_type != "Other" + dynamically_not_required << "other_tenancy_type" + end + required.delete_if { |key, _value| dynamically_not_required.include?(key) } end end diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index ed99d51cf..f4cf447c3 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -903,7 +903,15 @@ "3": "Lifetime – Assured", "4": "License agreement", "5": "Other" + }, + "conditional_for": { + "other_tenancy_type": ["Other"] } + }, + "other_tenancy_type": { + "header": "Please state the tenancy type", + "hint_text": "", + "type": "text" } } }, diff --git a/db/schema.rb b/db/schema.rb index 8d2405443..346f047c2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2021_10_27_091521) do +ActiveRecord::Schema.define(version: 2021_10_27_123535) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -132,6 +132,7 @@ ActiveRecord::Schema.define(version: 2021_10_27_091521) do t.boolean "reasonable_preference_reason_avoid_hardship" t.boolean "reasonable_preference_reason_do_not_know" t.datetime "discarded_at" + t.string "other_tenancy_type" t.index ["discarded_at"], name: "index_case_logs_on_discarded_at" end