Browse Source

remove type of building from location (#803)

Co-authored-by: Stéphane <smeny@users.noreply.github.com>

Co-authored-by: Stéphane <smeny@users.noreply.github.com>
pull/807/head
kosiakkatrina 2 years ago committed by GitHub
parent
commit
6357d1e5ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      app/models/location.rb
  2. 5
      db/migrate/20220802125711_remove_type_of_building.rb
  3. 3
      db/schema.rb
  4. 3
      db/seeds.rb
  5. 1
      spec/factories/location.rb
  6. 2
      spec/models/case_log_spec.rb

1
app/models/location.rb

@ -39,7 +39,6 @@ class Location < ApplicationRecord
{ name: "Location code ", value: location_code, suffix: false },
{ name: "Postcode", value: postcode, suffix: county },
{ name: "Type of unit", value: type_of_unit, suffix: false },
{ name: "Type of building", value: type_of_building, suffix: false },
]
end

5
db/migrate/20220802125711_remove_type_of_building.rb

@ -0,0 +1,5 @@
class RemoveTypeOfBuilding < ActiveRecord::Migration[7.0]
def change
remove_column :locations, :type_of_building, :string
end
end

3
db/schema.rb

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2022_07_22_083835) do
ActiveRecord::Schema[7.0].define(version: 2022_08_02_125711) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -239,7 +239,6 @@ ActiveRecord::Schema[7.0].define(version: 2022_07_22_083835) do
create_table "locations", force: :cascade do |t|
t.string "location_code"
t.string "postcode"
t.string "type_of_building"
t.bigint "scheme_id", null: false
t.string "name"
t.datetime "created_at", null: false

3
db/seeds.rb

@ -122,7 +122,6 @@ unless Rails.env.test?
name: "Rectory Road",
type_of_unit: 4,
units: 1,
type_of_building: "Purpose built",
mobility_type: "N",
)
@ -133,7 +132,6 @@ unless Rails.env.test?
name: "Smithy Lane",
type_of_unit: 1,
units: 1,
type_of_building: "Converted from previous residential or non-residential property",
mobility_type: "W",
)
@ -144,7 +142,6 @@ unless Rails.env.test?
name: "Smithy Lane",
type_of_unit: 2,
units: 1,
type_of_building: "Converted from previous residential or non-residential property",
mobility_type: "W",
)
end

1
spec/factories/location.rb

@ -4,7 +4,6 @@ FactoryBot.define do
name { Faker::Address.street_name }
type_of_unit { [1, 2, 3, 4, 6, 7].sample }
units { [1, 2, 3, 4, 6, 7].sample }
type_of_building { "Purpose built" }
mobility_type { %w[A M N W X].sample }
location_code { "E09000033" }
location_admin_district { "Westminster" }

2
spec/models/case_log_spec.rb

@ -1689,7 +1689,7 @@ RSpec.describe CaseLog do
context "and not renewal" do
let(:scheme) { FactoryBot.create(:scheme) }
let(:location) { FactoryBot.create(:location, scheme:, postcode: "M11AE", type_of_unit: 1, type_of_building: "Purpose built", mobility_type: "W") }
let(:location) { FactoryBot.create(:location, scheme:, postcode: "M11AE", type_of_unit: 1, mobility_type: "W") }
let(:supported_housing_case_log) do
described_class.create!({

Loading…
Cancel
Save