From 99be53a43f4d7e126964a6f5e59c90adbcebf35d Mon Sep 17 00:00:00 2001 From: JG Date: Tue, 5 Jul 2022 08:41:34 +0100 Subject: [PATCH] rebased --- app/views/locations/details.html.erb | 4 ++-- app/views/locations/new.html.erb | 4 ++-- db/migrate/20220630114748_add_name_to_locations.rb | 1 - db/schema.rb | 5 ++--- db/seeds.rb | 6 ------ 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/app/views/locations/details.html.erb b/app/views/locations/details.html.erb index 0092b0e6b..d132a0bfa 100644 --- a/app/views/locations/details.html.erb +++ b/app/views/locations/details.html.erb @@ -37,7 +37,7 @@ :name, legend: { text: "What is this type of scheme?", size: "m" } %> - <% wheelchair_user_selection = Location.wheelchair_adaptations.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> + <% wheelchair_user_selection = Location.wheelchair_adaptations.keys.reverse.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> <%= f.govuk_collection_radio_buttons :wheelchair_adaptation, wheelchair_user_selection, @@ -48,7 +48,7 @@ <%= govuk_section_break(visible: true, size: "m") %> - <% another_location_selection = %w[No Yes].map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> + <% another_location_selection = %w[Yes no].map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> <%= f.govuk_collection_radio_buttons :add_another_location, another_location_selection, diff --git a/app/views/locations/new.html.erb b/app/views/locations/new.html.erb index 1541d5b25..7c970fe7a 100644 --- a/app/views/locations/new.html.erb +++ b/app/views/locations/new.html.erb @@ -37,7 +37,7 @@ :name, legend: { text: "What is this type of scheme?", size: "m" } %> - <% wheelchair_user_selection = Location.wheelchair_adaptations.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> + <% wheelchair_user_selection = Location.wheelchair_adaptations.keys.reverse.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> <%= f.govuk_collection_radio_buttons :wheelchair_adaptation, wheelchair_user_selection, @@ -48,7 +48,7 @@ <%= govuk_section_break(visible: true, size: "m") %> - <% another_location_selection = %w[No Yes].map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> + <% another_location_selection = %w[Yes No].map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> <%= f.govuk_collection_radio_buttons :add_another_location, another_location_selection, diff --git a/db/migrate/20220630114748_add_name_to_locations.rb b/db/migrate/20220630114748_add_name_to_locations.rb index 4b94abea1..8da11bb69 100644 --- a/db/migrate/20220630114748_add_name_to_locations.rb +++ b/db/migrate/20220630114748_add_name_to_locations.rb @@ -1,6 +1,5 @@ class AddNameToLocations < ActiveRecord::Migration[7.0] change_table :locations, bulk: true do |t| - t.string :name t.integer :total_units end end diff --git a/db/schema.rb b/db/schema.rb index 018085d90..62044426f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -191,9 +191,9 @@ ActiveRecord::Schema[7.0].define(version: 2022_07_04_135746) do t.integer "joint" t.bigint "created_by_id" t.integer "illness_type_0" + t.integer "retirement_value_check" t.integer "tshortfall_known" t.integer "sheltered" - t.integer "retirement_value_check" t.integer "pregnancy_value_check" t.integer "hhtype" t.integer "new_old" @@ -246,7 +246,6 @@ ActiveRecord::Schema[7.0].define(version: 2022_07_04_135746) do t.string "county" t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.string "name" t.integer "total_units" t.integer "type_of_unit" t.index ["scheme_id"], name: "index_locations_on_scheme_id" @@ -254,7 +253,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_07_04_135746) do create_table "logs_exports", force: :cascade do |t| t.datetime "created_at", default: -> { "CURRENT_TIMESTAMP" } - t.datetime "started_at", precision: nil, null: false + t.datetime "started_at", null: false t.integer "base_number", default: 1, null: false t.integer "increment_number", default: 1, null: false t.boolean "empty_export", default: false, null: false diff --git a/db/seeds.rb b/db/seeds.rb index 968cde114..175922921 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -114,8 +114,6 @@ unless Rails.env.test? location_code: "S254-CU193AA", postcode: "CU19 3AA", name: "Rectory Road", - address_line1: "Rectory Road", - address_line2: "North Chaim", type_of_unit: 4, type_of_building: "Purpose-built", county: "Mid Sussex", @@ -127,8 +125,6 @@ unless Rails.env.test? location_code: "S254-DM250DC", postcode: "DM25 0DC", name: "Smithy Lane", - address_line1: "Smithy Lane", - address_line2: "North Kellieworth", type_of_unit: 1, type_of_building: "Converted from previous residential or non-residential property", county: "Fife", @@ -140,8 +136,6 @@ unless Rails.env.test? location_code: "S254-YX130WP", postcode: "YX13 0WP", name: "Smithy Lane", - address_line1: "Smithy Lane", - address_line2: "East Darwin", type_of_unit: 2, type_of_building: "Converted from previous residential or non-residential property", county: "Rochford",