From 772f02eeb2ba179f8ecf30e5b1cb20c46c2b6b83 Mon Sep 17 00:00:00 2001 From: JG Date: Tue, 14 Jun 2022 13:49:59 +0100 Subject: [PATCH] created locations --- app/helpers/navigation_items_helper.rb | 4 ++-- db/schema.rb | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/helpers/navigation_items_helper.rb b/app/helpers/navigation_items_helper.rb index a463389d6..e8957e2aa 100644 --- a/app/helpers/navigation_items_helper.rb +++ b/app/helpers/navigation_items_helper.rb @@ -34,10 +34,10 @@ module NavigationItemsHelper ] end - def scheme_items(path, current_scheme_id) + def scheme_items(path, current_scheme_id, count) [ NavigationItem.new("Scheme", "/supported-housing/#{current_scheme_id}", true), - NavigationItem.new("Locations", "/supported-housing/#{current_scheme_id}/locations", false), + NavigationItem.new("#{count} locations", "/supported-housing/#{current_scheme_id}/locations", false), ] end diff --git a/db/schema.rb b/db/schema.rb index 6a4e5f2ea..d83363804 100644 --- a/db/schema.rb +++ b/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_06_13_094847) do +ActiveRecord::Schema[7.0].define(version: 2022_06_14_124115) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -230,6 +230,21 @@ ActiveRecord::Schema[7.0].define(version: 2022_06_13_094847) do t.index ["start_year", "lettype", "beds", "la"], name: "index_la_rent_ranges_on_start_year_and_lettype_and_beds_and_la", unique: true end + create_table "locations", force: :cascade do |t| + t.string "location_code" + t.string "postcode" + t.string "type_of_unit" + t.string "type_of_building" + t.integer "wheelchair_adaptation" + t.bigint "scheme_id", null: false + t.string "address_line1" + t.string "address_line2" + t.string "county" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["scheme_id"], name: "index_locations_on_scheme_id" + end + create_table "logs_exports", force: :cascade do |t| t.datetime "created_at", default: -> { "CURRENT_TIMESTAMP" } t.datetime "started_at", null: false @@ -347,5 +362,6 @@ ActiveRecord::Schema[7.0].define(version: 2022_06_13_094847) do t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id" end + add_foreign_key "locations", "schemes" add_foreign_key "schemes", "organisations" end