Browse Source

Update majorrepairs, national and reasonpref

pull/83/head
Kat 4 years ago
parent
commit
73906100dd
  1. 11
      app/constants/db_enums.rb
  2. 3
      app/models/case_log.rb
  3. 12
      config/forms/2021_2022.json
  4. 2
      db/migrate/20211108143649_change_reason_type.rb
  5. 2
      db/schema.rb

11
app/constants/db_enums.rb

@ -90,6 +90,9 @@ module DbEnums
"Bulgaria" => 14,
"Romania" => 15,
"Ireland" => 17,
"Slovakia" => 9,
"Slovenia" => 10,
"Croatia" => 16,
"Other EU Economic Area (EEA country)" => 11,
"Any other country" => 12,
"Prefer not to say" => 13,
@ -154,6 +157,14 @@ module DbEnums
}
end
def self.polar_with_unknown
{
"No" => 2,
"Yes" => 1,
"Do not know" => 3,
}
end
def self.tenancy
{
"Fixed term – Secure" => 1,

3
app/models/case_log.rb

@ -100,10 +100,11 @@ class CaseLog < ApplicationRecord
enum period: DbEnums.period, _suffix: true
enum layear: DbEnums.latime, _suffix: true
enum lawaitlist: DbEnums.latime, _suffix: true
enum reasonpref: DbEnums.polar2, _suffix: true
enum reasonpref: DbEnums.polar_with_unknown, _suffix: true
enum reason: DbEnums.reason, _suffix: true
enum la: DbEnums.la, _suffix: true
enum prevloc: DbEnums.la, _suffix: true
enum majorrepairs: DbEnums.polar, _suffix: true
AUTOGENERATED_FIELDS = %w[id status created_at updated_at discarded_at].freeze

12
config/forms/2021_2022.json

@ -285,9 +285,12 @@
"10": "Bulgaria",
"11": "Romania",
"12": "Ireland",
"13": "Other EU Economic Area (EEA country)",
"14": "Any other country",
"15": "Prefer not to say"
"13": "Slovakia",
"14":"Slovenia",
"15": "Croatia",
"16": "Other EU Economic Area (EEA country)",
"17": "Any other country",
"18": "Prefer not to say"
}
}
}
@ -2237,7 +2240,8 @@
"type": "radio",
"answer_options": {
"0": "Yes",
"1": "No"
"1": "No",
"2": "Do not know"
},
"conditional_for": {
"reasonable_preference_reason": ["Yes"]

2
db/migrate/20211108143649_change_reason_type.rb

@ -2,12 +2,14 @@ class ChangeReasonType < ActiveRecord::Migration[6.1]
def up
change_table :case_logs, bulk: true do |t|
t.change :reason, "integer USING reason::integer"
t.change :majorrepairs, "integer USING majorrepairs::integer"
end
end
def down
change_table :case_logs, bulk: true do |t|
t.change :reason, :string
t.change :majorrepairs, :string
end
end
end

2
db/schema.rb

@ -82,7 +82,7 @@ ActiveRecord::Schema.define(version: 2021_11_08_143649) do
t.string "property_building_type"
t.integer "beds"
t.string "property_void_date"
t.string "majorrepairs"
t.integer "majorrepairs"
t.string "property_major_repairs_date"
t.integer "offered"
t.integer "wchair"

Loading…
Cancel
Save