diff --git a/.env.example b/.env.example index c4657e87..9194c7fc 100644 --- a/.env.example +++ b/.env.example @@ -2,6 +2,8 @@ #DC_WEB_LIB_REGISTER_SOURCES_BODS=../register-sources-bods #DC_WEB_LIB_REGISTER_SOURCES_OC=../register-sources-oc #DC_WEB_LIB_REGISTER_SOURCES_PSC=../register-sources-psc +#DC_WEB_LIB_REGISTER_SOURCES_SK=../register-sources-sk +#DC_WEB_LIB_REGISTER_SOURCES_DK=../register-sources-dk ADMIN_EMAILS= BODS_EXPORT_AWS_REGION=eu-west-1 BODS_EXPORT_AWS_ACCESS_KEY_ID= diff --git a/app/service_objects/bods_statement_sorter.rb b/app/service_objects/bods_statement_sorter.rb index 5292cfbe..19e83425 100755 --- a/app/service_objects/bods_statement_sorter.rb +++ b/app/service_objects/bods_statement_sorter.rb @@ -6,7 +6,7 @@ class BodsStatementSorter def sort_statements(statements) statements = statements.sort_by { |statement| statement.publicationDetails&.publicationDate } - statements_by_id = statements.map { |statement| [statement.statementID, statement] }.to_h + statements_by_id = statements.to_h { |statement| [statement.statementID, statement] } used_ids = Set.new new_statements = [] diff --git a/app/views/pages/download.html.haml b/app/views/pages/download.html.haml index 71cdf5e7..0f426cd6 100644 --- a/app/views/pages/download.html.haml +++ b/app/views/pages/download.html.haml @@ -30,7 +30,7 @@ %p Links to the most recent files we've exported: %ul - @exports.each do |export| - %li= link_to export.created_at.to_date, "https://#{ENV['BODS_EXPORT_S3_BUCKET_NAME']}.s3-eu-west-1.amazonaws.com/#{export.s3_path}", rel: 'nofollow' + %li= link_to export.created_at.to_date, "https://#{ENV.fetch('BODS_EXPORT_S3_BUCKET_NAME')}.s3-eu-west-1.amazonaws.com/#{export.s3_path}", rel: 'nofollow' %h2{ id: 'what-is-it' } What is this data? %p diff --git a/bin/configure-dev-lib b/bin/configure-dev-lib index 1add3bed..7e801744 100755 --- a/bin/configure-dev-lib +++ b/bin/configure-dev-lib @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -Eeuo pipefail -libs=(register-common register-sources-bods register-sources-oc register-sources-psc) +libs=(register-common register-sources-bods register-sources-oc register-sources-psc register-sources-sk register-sources-dk) echo -e "\n=== Configuring dev libs" diff --git a/docker-compose.yml b/docker-compose.yml index 36196cc4..034f2696 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,6 +21,8 @@ services: - ${DC_WEB_LIB_REGISTER_SOURCES_BODS:-.dockerempty}:/home/x/lib/register-sources-bods - ${DC_WEB_LIB_REGISTER_SOURCES_OC:-.dockerempty}:/home/x/lib/register-sources-oc - ${DC_WEB_LIB_REGISTER_SOURCES_PSC:-.dockerempty}:/home/x/lib/register-sources-psc + - ${DC_WEB_LIB_REGISTER_SOURCES_DK:-.dockerempty}:/home/x/lib/register-sources-dk + - ${DC_WEB_LIB_REGISTER_SOURCES_SK:-.dockerempty}:/home/x/lib/register-sources-sk - ./app:/home/x/r/app - ./bin:/home/x/r/bin - ./config:/home/x/r/config