Browse Source

add enums and switch to ints

pull/95/head
magicmilo 3 years ago
parent
commit
e6d59173b4
  1. 3
      app/models/case_log.rb
  2. 12
      config/forms/2021_2022.json
  3. 6
      db/migrate/20211119104835_add_property_info_fields.rb
  4. 6
      db/schema.rb

3
app/models/case_log.rb

@ -110,6 +110,9 @@ class CaseLog < ApplicationRecord
enum hbrentshortfall: DbEnums.polar_with_unknown, _suffix: true
enum property_relet: DbEnums.polar, _suffix: true
enum armedforces: DbEnums.armed_forces, _suffix: true
enum first_time_property_let_as_social_housing: DbEnums.polar, _suffix: true
enum do_you_know_the_postcode: DbEnums.polar, _suffix: true
enum do_you_know_the_local_authority: DbEnums.polar, _suffix: true
AUTOGENERATED_FIELDS = %w[id status created_at updated_at discarded_at].freeze

12
config/forms/2021_2022.json

@ -1124,8 +1124,8 @@
"hint_text": "",
"type": "radio",
"answer_options": {
"0": "Yes",
"1": "No"
"0": "No",
"1": "Yes"
},
"conditional_for": {
"postcode": ["Yes"]
@ -1149,8 +1149,8 @@
"hint_text": "",
"type": "radio",
"answer_options": {
"0": "Yes",
"1": "No"
"0": "No",
"1": "Yes"
}
}
}
@ -1506,8 +1506,8 @@
"hint_text": "",
"type": "radio",
"answer_options": {
"0": "Yes",
"1": "No"
"0": "No",
"1": "Yes"
}
}
},

6
db/migrate/20211119104835_add_property_info_fields.rb

@ -1,10 +1,10 @@
class AddPropertyInfoFields < ActiveRecord::Migration[6.1]
def change
change_table :case_logs, bulk: true do |t|
t.column :do_you_know_the_postcode, :string
t.column :do_you_know_the_local_authority, :string
t.column :do_you_know_the_postcode, :int
t.column :do_you_know_the_local_authority, :int
t.column :first_time_property_let_as_social_housing, :int
t.column :why_dont_you_know_la, :string
t.column :first_time_property_let_as_social_housing, :string
t.column :type_property_most_recently_let_as, :string
t.column :builtype, :string
t.rename :tenant_same_property_renewal, :renewal

6
db/schema.rb

@ -154,10 +154,10 @@ ActiveRecord::Schema.define(version: 2021_11_19_104835) do
t.integer "incref"
t.datetime "sale_completion_date"
t.datetime "startdate"
t.string "do_you_know_the_postcode"
t.string "do_you_know_the_local_authority"
t.integer "do_you_know_the_postcode"
t.integer "do_you_know_the_local_authority"
t.integer "first_time_property_let_as_social_housing"
t.string "why_dont_you_know_la"
t.string "first_time_property_let_as_social_housing"
t.string "type_property_most_recently_let_as"
t.string "builtype"
t.index ["discarded_at"], name: "index_case_logs_on_discarded_at"

Loading…
Cancel
Save