Browse Source

Remove checkbox parent fields (#292)

* Remove checkbox parent fields

* Also remove reasonable preference reason

* Update spec fixture
pull/280/head
baarkerlounger 3 years ago committed by GitHub
parent
commit
c1ddf5d033
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      Gemfile.lock
  2. 17
      db/migrate/20220210132254_remove_checkbox_parent_fields.rb
  3. 48
      db/schema.rb
  4. 3
      spec/factories/case_log.rb
  5. 2
      spec/fixtures/complete_case_log.json
  6. 6
      spec/fixtures/exports/case_logs.xml

14
Gemfile.lock

@ -340,14 +340,14 @@ GEM
nokogiri (~> 1) nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0) rubyzip (>= 1.3.0, < 3.0.0)
rotp (6.2.0) rotp (6.2.0)
rspec-core (3.10.2) rspec-core (3.11.0)
rspec-support (~> 3.10.0) rspec-support (~> 3.11.0)
rspec-expectations (3.10.2) rspec-expectations (3.11.0)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0) rspec-support (~> 3.11.0)
rspec-mocks (3.10.3) rspec-mocks (3.11.0)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0) rspec-support (~> 3.11.0)
rspec-rails (5.1.0) rspec-rails (5.1.0)
actionpack (>= 5.2) actionpack (>= 5.2)
activesupport (>= 5.2) activesupport (>= 5.2)
@ -356,7 +356,7 @@ GEM
rspec-expectations (~> 3.10) rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10) rspec-mocks (~> 3.10)
rspec-support (~> 3.10) rspec-support (~> 3.10)
rspec-support (3.10.3) rspec-support (3.11.0)
rubocop (1.25.0) rubocop (1.25.0)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 3.1.0.0) parser (>= 3.1.0.0)

17
db/migrate/20220210132254_remove_checkbox_parent_fields.rb

@ -0,0 +1,17 @@
class RemoveCheckboxParentFields < ActiveRecord::Migration[7.0]
def up
change_table :case_logs, bulk: true do |t|
t.remove :accessibility_requirements
t.remove :condition_effects
t.remove :reasonable_preference_reason
end
end
def down
change_table :case_logs, bulk: true do |t|
t.column :accessibility_requirements, :string
t.column :condition_effects, :string
t.remove :reasonable_preference_reason, :string
end
end
end

48
db/schema.rb

@ -10,8 +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: 202202071123100) do ActiveRecord::Schema[7.0].define(version: 202202071123100) 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"
@ -19,25 +18,25 @@ ActiveRecord::Schema.define(version: 202202071123100) do
t.string "email", default: "", null: false t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false t.string "encrypted_password", default: "", null: false
t.string "reset_password_token" t.string "reset_password_token"
t.datetime "reset_password_sent_at" t.datetime "reset_password_sent_at", precision: nil
t.datetime "remember_created_at" t.datetime "remember_created_at", precision: nil
t.datetime "created_at", precision: 6, null: false t.datetime "created_at", null: false
t.datetime "updated_at", precision: 6, null: false t.datetime "updated_at", null: false
t.integer "second_factor_attempts_count", default: 0 t.integer "second_factor_attempts_count", default: 0
t.string "encrypted_otp_secret_key" t.string "encrypted_otp_secret_key"
t.string "encrypted_otp_secret_key_iv" t.string "encrypted_otp_secret_key_iv"
t.string "encrypted_otp_secret_key_salt" t.string "encrypted_otp_secret_key_salt"
t.string "direct_otp" t.string "direct_otp"
t.datetime "direct_otp_sent_at" t.datetime "direct_otp_sent_at", precision: nil
t.datetime "totp_timestamp" t.datetime "totp_timestamp", precision: nil
t.string "phone" t.string "phone"
t.index ["encrypted_otp_secret_key"], name: "index_admin_users_on_encrypted_otp_secret_key", unique: true t.index ["encrypted_otp_secret_key"], name: "index_admin_users_on_encrypted_otp_secret_key", unique: true
end end
create_table "case_logs", force: :cascade do |t| create_table "case_logs", force: :cascade do |t|
t.integer "status", default: 0 t.integer "status", default: 0
t.datetime "created_at", precision: 6, null: false t.datetime "created_at", null: false
t.datetime "updated_at", precision: 6, null: false t.datetime "updated_at", null: false
t.string "tenant_code" t.string "tenant_code"
t.integer "age1" t.integer "age1"
t.string "sex1" t.string "sex1"
@ -80,8 +79,6 @@ ActiveRecord::Schema.define(version: 202202071123100) do
t.integer "reservist" t.integer "reservist"
t.integer "illness" t.integer "illness"
t.integer "preg_occ" t.integer "preg_occ"
t.string "accessibility_requirements"
t.string "condition_effects"
t.string "tenancy_code" t.string "tenancy_code"
t.integer "startertenancy" t.integer "startertenancy"
t.integer "tenancylength" t.integer "tenancylength"
@ -101,7 +98,6 @@ ActiveRecord::Schema.define(version: 202202071123100) do
t.integer "lawaitlist" t.integer "lawaitlist"
t.string "property_postcode" t.string "property_postcode"
t.integer "reasonpref" t.integer "reasonpref"
t.string "reasonable_preference_reason"
t.integer "cbl" t.integer "cbl"
t.integer "chr" t.integer "chr"
t.integer "cap" t.integer "cap"
@ -149,19 +145,19 @@ ActiveRecord::Schema.define(version: 202202071123100) do
t.string "ppostc1" t.string "ppostc1"
t.string "ppostc2" t.string "ppostc2"
t.integer "property_relet" t.integer "property_relet"
t.datetime "mrcdate" t.datetime "mrcdate", precision: nil
t.integer "mrcday" t.integer "mrcday"
t.integer "mrcmonth" t.integer "mrcmonth"
t.integer "mrcyear" t.integer "mrcyear"
t.integer "other_hhmemb" t.integer "other_hhmemb"
t.integer "incref" t.integer "incref"
t.datetime "sale_completion_date" t.datetime "sale_completion_date", precision: nil
t.datetime "startdate" t.datetime "startdate", precision: nil
t.integer "armedforces" t.integer "armedforces"
t.integer "first_time_property_let_as_social_housing" t.integer "first_time_property_let_as_social_housing"
t.integer "unitletas" t.integer "unitletas"
t.integer "builtype" t.integer "builtype"
t.datetime "property_void_date" t.datetime "property_void_date", precision: nil
t.bigint "owning_organisation_id" t.bigint "owning_organisation_id"
t.bigint "managing_organisation_id" t.bigint "managing_organisation_id"
t.integer "renttype" t.integer "renttype"
@ -206,8 +202,8 @@ ActiveRecord::Schema.define(version: 202202071123100) do
t.boolean "holds_own_stock" t.boolean "holds_own_stock"
t.string "other_stock_owners" t.string "other_stock_owners"
t.string "managing_agents" t.string "managing_agents"
t.datetime "created_at", precision: 6, null: false t.datetime "created_at", null: false
t.datetime "updated_at", precision: 6, null: false t.datetime "updated_at", null: false
t.boolean "active" t.boolean "active"
t.integer "old_association_type" t.integer "old_association_type"
t.string "software_supplier_id" t.string "software_supplier_id"
@ -231,15 +227,15 @@ ActiveRecord::Schema.define(version: 202202071123100) do
t.string "email", default: "", null: false t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false t.string "encrypted_password", default: "", null: false
t.string "reset_password_token" t.string "reset_password_token"
t.datetime "reset_password_sent_at" t.datetime "reset_password_sent_at", precision: nil
t.datetime "remember_created_at" t.datetime "remember_created_at", precision: nil
t.datetime "created_at", precision: 6, null: false t.datetime "created_at", null: false
t.datetime "updated_at", precision: 6, null: false t.datetime "updated_at", null: false
t.string "name" t.string "name"
t.bigint "organisation_id" t.bigint "organisation_id"
t.integer "sign_in_count", default: 0, null: false t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at" t.datetime "current_sign_in_at", precision: nil
t.datetime "last_sign_in_at" t.datetime "last_sign_in_at", precision: nil
t.string "current_sign_in_ip" t.string "current_sign_in_ip"
t.string "last_sign_in_ip" t.string "last_sign_in_ip"
t.integer "role" t.integer "role"
@ -256,7 +252,7 @@ ActiveRecord::Schema.define(version: 202202071123100) do
t.string "event", null: false t.string "event", null: false
t.string "whodunnit" t.string "whodunnit"
t.text "object" t.text "object"
t.datetime "created_at", precision: 6 t.datetime "created_at"
t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id" t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
end end

3
spec/factories/case_log.rb

@ -53,8 +53,6 @@ FactoryBot.define do
reservist { "No" } reservist { "No" }
illness { "Yes" } illness { "Yes" }
preg_occ { "Yes" } preg_occ { "Yes" }
accessibility_requirements { "No" }
condition_effects { "dummy" }
tenancy_code { "BZ757" } tenancy_code { "BZ757" }
startertenancy { "No" } startertenancy { "No" }
tenancylength { 5 } tenancylength { 5 }
@ -81,7 +79,6 @@ FactoryBot.define do
lawaitlist { "Less than 1 year" } lawaitlist { "Less than 1 year" }
property_postcode { "NW1 5TY" } property_postcode { "NW1 5TY" }
reasonpref { "Yes" } reasonpref { "Yes" }
reasonable_preference_reason { "dummy" }
cbl { "Yes" } cbl { "Yes" }
chr { "Yes" } chr { "Yes" }
cap { "No" } cap { "No" }

2
spec/fixtures/complete_case_log.json vendored

@ -47,8 +47,6 @@
"reservist": "No", "reservist": "No",
"illness": "Yes", "illness": "Yes",
"preg_occ": "No", "preg_occ": "No",
"accessibility_requirements": "No",
"condition_effects": "dummy",
"tenancy_code": "BZ757", "tenancy_code": "BZ757",
"startdate": "12/12/2021", "startdate": "12/12/2021",
"day": 12, "day": 12,

6
spec/fixtures/exports/case_logs.xml vendored

@ -47,8 +47,6 @@
<reservist>No</reservist> <reservist>No</reservist>
<illness>Yes</illness> <illness>Yes</illness>
<preg_occ>Yes</preg_occ> <preg_occ>Yes</preg_occ>
<accessibility_requirements>No</accessibility_requirements>
<condition_effects>dummy</condition_effects>
<tenancy_code>BZ757</tenancy_code> <tenancy_code>BZ757</tenancy_code>
<startertenancy>No</startertenancy> <startertenancy>No</startertenancy>
<tenancylength>5</tenancylength> <tenancylength>5</tenancylength>
@ -68,7 +66,6 @@
<lawaitlist>Less than 1 year</lawaitlist> <lawaitlist>Less than 1 year</lawaitlist>
<property_postcode>NW1 5TY</property_postcode> <property_postcode>NW1 5TY</property_postcode>
<reasonpref>Yes</reasonpref> <reasonpref>Yes</reasonpref>
<reasonable_preference_reason>dummy</reasonable_preference_reason>
<cbl>Yes</cbl> <cbl>Yes</cbl>
<chr>Yes</chr> <chr>Yes</chr>
<cap>No</cap> <cap>No</cap>
@ -206,8 +203,6 @@
<reservist>No</reservist> <reservist>No</reservist>
<illness>Yes</illness> <illness>Yes</illness>
<preg_occ>Yes</preg_occ> <preg_occ>Yes</preg_occ>
<accessibility_requirements>No</accessibility_requirements>
<condition_effects>dummy</condition_effects>
<tenancy_code>BZ757</tenancy_code> <tenancy_code>BZ757</tenancy_code>
<startertenancy>No</startertenancy> <startertenancy>No</startertenancy>
<tenancylength>5</tenancylength> <tenancylength>5</tenancylength>
@ -227,7 +222,6 @@
<lawaitlist>Less than 1 year</lawaitlist> <lawaitlist>Less than 1 year</lawaitlist>
<property_postcode>NW1 5TY</property_postcode> <property_postcode>NW1 5TY</property_postcode>
<reasonpref>Yes</reasonpref> <reasonpref>Yes</reasonpref>
<reasonable_preference_reason>dummy</reasonable_preference_reason>
<cbl>Yes</cbl> <cbl>Yes</cbl>
<chr>Yes</chr> <chr>Yes</chr>
<cap>No</cap> <cap>No</cap>

Loading…
Cancel
Save