Browse Source

created locations

pull/662/head
JG 3 years ago
parent
commit
772f02eeb2
  1. 4
      app/helpers/navigation_items_helper.rb
  2. 18
      db/schema.rb

4
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

18
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

Loading…
Cancel
Save