Browse Source

Add other_tenancy_type conditional field

pull/68/head
Kat 4 years ago
parent
commit
9c3ec388db
  1. 4
      app/models/case_log.rb
  2. 8
      config/forms/2021_2022.json
  3. 3
      db/schema.rb

4
app/models/case_log.rb

@ -209,6 +209,10 @@ private
dynamically_not_required << "fixed_term_tenancy" dynamically_not_required << "fixed_term_tenancy"
end end
if tenancy_type != "Other"
dynamically_not_required << "other_tenancy_type"
end
required.delete_if { |key, _value| dynamically_not_required.include?(key) } required.delete_if { |key, _value| dynamically_not_required.include?(key) }
end end
end end

8
config/forms/2021_2022.json

@ -903,7 +903,15 @@
"3": "Lifetime – Assured", "3": "Lifetime – Assured",
"4": "License agreement", "4": "License agreement",
"5": "Other" "5": "Other"
},
"conditional_for": {
"other_tenancy_type": ["Other"]
} }
},
"other_tenancy_type": {
"header": "Please state the tenancy type",
"hint_text": "",
"type": "text"
} }
} }
}, },

3
db/schema.rb

@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # 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 # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" 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_avoid_hardship"
t.boolean "reasonable_preference_reason_do_not_know" t.boolean "reasonable_preference_reason_do_not_know"
t.datetime "discarded_at" t.datetime "discarded_at"
t.string "other_tenancy_type"
t.index ["discarded_at"], name: "index_case_logs_on_discarded_at" t.index ["discarded_at"], name: "index_case_logs_on_discarded_at"
end end

Loading…
Cancel
Save