diff --git a/Gemfile b/Gemfile index 5385d041d8..e2155cbb3a 100644 --- a/Gemfile +++ b/Gemfile @@ -18,8 +18,8 @@ gem "faraday" gem "indefinite_article" gem "jsbundling-rails" gem "okcomputer" -gem "omniauth-azure-activedirectory-v2", "~> 2.1" -gem "omniauth-rails_csrf_protection", "~> 1.0" +gem "omniauth-azure-activedirectory-v2" +gem "omniauth-rails_csrf_protection" gem "pagy" gem "pg" gem "propshaft" diff --git a/Gemfile.lock b/Gemfile.lock index d5f95c662e..86f57f6ba2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -141,7 +141,7 @@ GEM cgi (0.3.6) climate_control (1.2.0) concurrent-ruby (1.2.2) - connection_pool (2.4.0) + connection_pool (2.4.1) crack (0.4.5) rexml crass (1.0.6) @@ -216,7 +216,7 @@ GEM concurrent-ruby (~> 1.1) webrick (~> 1.7) websocket-driver (>= 0.6, < 0.8) - ffi (1.15.5) + ffi (1.16.3) fugit (1.8.1) et-orbi (~> 1, >= 1.2.7) raabro (~> 1.4) @@ -263,7 +263,7 @@ GEM govuk_markdown (2.0.1) activesupport redcarpet - haml (6.1.1) + haml (6.2.3) temple (>= 0.8.2) thor tilt @@ -277,8 +277,9 @@ GEM indefinite_article (0.2.5) activesupport io-console (0.6.0) - irb (1.6.4) - reline (>= 0.3.0) + irb (1.8.1) + rdoc + reline (>= 0.3.8) jsbundling-rails (1.2.1) railties (>= 6.0.0) json (2.6.3) @@ -304,12 +305,12 @@ GEM method_source (1.0.0) mini_mime (1.1.5) minitest (5.20.0) - msgpack (1.6.1) + msgpack (1.7.2) multi_json (1.15.0) multi_xml (0.6.0) multipart-post (2.3.0) mutex_m (0.1.2) - net-http-persistent (4.0.1) + net-http-persistent (4.0.2) connection_pool (~> 2.2) net-imap (0.4.0) date @@ -353,7 +354,7 @@ GEM os (1.1.4) pagy (6.1.0) parallel (1.23.0) - parser (3.2.2.3) + parser (3.2.2.4) ast (~> 2.4.1) racc pg (1.5.4) @@ -363,6 +364,8 @@ GEM activesupport (>= 7.0.0) rack railties (>= 7.0.0) + psych (5.1.0) + stringio public_suffix (5.0.3) puma (6.4.0) nio4r (~> 2.0) @@ -413,11 +416,13 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.0.6) - rbs (3.0.3) + rbs (3.2.2) + rdoc (6.5.0) + psych (>= 4.0.0) redcarpet (3.6.0) redis (4.8.1) regexp_parser (2.8.1) - reline (0.3.3) + reline (0.3.9) io-console (~> 0.5) representable (3.2.0) declarative (< 0.1.0) @@ -440,7 +445,7 @@ GEM rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.5) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-rails (6.0.3) @@ -451,7 +456,7 @@ GEM rspec-expectations (~> 3.12) rspec-mocks (~> 3.12) rspec-support (~> 3.12) - rspec-support (3.12.0) + rspec-support (3.12.1) rubocop (1.55.0) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -465,9 +470,9 @@ GEM unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.29.0) parser (>= 3.2.1.0) - rubocop-capybara (2.18.0) + rubocop-capybara (2.19.0) rubocop (~> 1.41) - rubocop-factory_bot (2.23.1) + rubocop-factory_bot (2.24.0) rubocop (~> 1.33) rubocop-govuk (4.12.0) rubocop (= 1.55.0) @@ -496,7 +501,7 @@ GEM concurrent-ruby (~> 1.0, >= 1.0.2) shoulda-matchers (5.3.0) activesupport (>= 5.2.0) - sidekiq (6.5.8) + sidekiq (6.5.11) connection_pool (>= 2.2.5, < 3) rack (~> 2.0) redis (>= 4.5.0, < 5) @@ -515,12 +520,13 @@ GEM addressable (~> 2.8) capybara (~> 3.27) site_prism-all_there (~> 2.0) - site_prism-all_there (2.0.1) + site_prism-all_there (2.0.2) sitemap_generator (6.3.0) builder (~> 3.0) snaky_hash (2.0.1) hashie version_gem (~> 1.1, >= 1.1.1) + stringio (3.0.8) syntax_tree (6.2.0) prettier_print (>= 1.2.0) syntax_tree-haml (4.0.3) @@ -531,9 +537,9 @@ GEM prettier_print rbs syntax_tree (>= 2.0.1) - temple (0.10.0) + temple (0.10.3) thor (1.2.2) - tilt (2.1.0) + tilt (2.3.0) timeout (0.4.0) trailblazer-option (0.1.2) tzinfo (2.0.6) @@ -542,7 +548,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.8.2) - unicode-display_width (2.4.2) + unicode-display_width (2.5.0) validate_url (1.0.15) activemodel (>= 3.0.0) public_suffix @@ -606,8 +612,8 @@ DEPENDENCIES jsbundling-rails mail-notify okcomputer - omniauth-azure-activedirectory-v2 (~> 2.1) - omniauth-rails_csrf_protection (~> 1.0) + omniauth-azure-activedirectory-v2 + omniauth-rails_csrf_protection pagy pg prettier_print diff --git a/config/initializers/govuk_markdown.rb b/config/initializers/govuk_markdown.rb index e55e3513f8..63014542db 100644 --- a/config/initializers/govuk_markdown.rb +++ b/config/initializers/govuk_markdown.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + class MarkdownTemplate def self.call(template, source) erb_handler = ActionView::Template.registered_template_handler(:erb) compiled_source = erb_handler.call(template, source) - "GovukMarkdown.render(begin;#{compiled_source};end).html_safe" + "GovukMarkdown.render(begin;#{compiled_source};end.to_str).html_safe" end end diff --git a/db/migrate/20220801091806_add_region_to_application_form.rb b/db/migrate/20220801091806_add_region_to_application_form.rb index 8c4947caf6..cc40fc9d60 100644 --- a/db/migrate/20220801091806_add_region_to_application_form.rb +++ b/db/migrate/20220801091806_add_region_to_application_form.rb @@ -1,13 +1,6 @@ class AddRegionToApplicationForm < ActiveRecord::Migration[7.0] def up add_reference :application_forms, :region, foreign_key: true, null: true - - ApplicationForm.find_each do |application_form| - eligibility_check = - EligibilityCheck.find(application_form.eligibility_check_id) - application_form.update!(region_id: eligibility_check.region_id) - end - change_column_null :application_forms, :region_id, false end diff --git a/db/schema.rb b/db/schema.rb index 3db365af7a..66472b2064 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: 2023_10_04_150531) do +ActiveRecord::Schema[7.1].define(version: 2023_10_04_150531) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -84,9 +84,9 @@ t.bigint "english_language_provider_id" t.text "english_language_provider_reference", default: "", null: false t.datetime "awarded_at" - t.boolean "reduced_evidence_accepted", default: false, null: false t.boolean "teaching_authority_provides_written_statement", default: false, null: false t.boolean "written_statement_confirmation", default: false, null: false + t.boolean "reduced_evidence_accepted", default: false, null: false t.boolean "english_language_provider_other", default: false, null: false t.datetime "declined_at" t.boolean "waiting_on_professional_standing", default: false, null: false @@ -97,8 +97,8 @@ t.boolean "received_reference", default: false, null: false t.boolean "waiting_on_qualification", default: false, null: false t.boolean "received_qualification", default: false, null: false - t.boolean "written_statement_optional", default: false, null: false t.boolean "requires_preliminary_check", default: false, null: false + t.boolean "written_statement_optional", default: false, null: false t.boolean "overdue_further_information", default: false, null: false t.boolean "overdue_professional_standing", default: false, null: false t.boolean "overdue_qualification", default: false, null: false @@ -142,7 +142,7 @@ t.integer "age_range_min" t.integer "age_range_max" t.text "subjects", default: [], null: false, array: true - t.datetime "recommended_at", precision: nil + t.datetime "recommended_at" t.text "age_range_note", default: "", null: false t.text "subjects_note", default: "", null: false t.datetime "started_at" @@ -165,8 +165,8 @@ t.string "status_information", default: "", null: false t.string "sanction_information", default: "", null: false t.boolean "eligibility_enabled", default: true, null: false - t.boolean "eligibility_skip_questions", default: false, null: false t.text "qualifications_information", default: "", null: false + t.boolean "eligibility_skip_questions", default: false, null: false t.boolean "subject_limited", default: false, null: false t.index ["code"], name: "index_countries_on_code", unique: true end @@ -276,7 +276,7 @@ t.text "location_note", default: "", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.datetime "reviewed_at", precision: nil + t.datetime "reviewed_at" t.boolean "review_passed" t.string "review_note", default: "", null: false t.boolean "ready_for_review", default: false, null: false @@ -295,7 +295,7 @@ t.text "location_note", default: "", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.datetime "reviewed_at", precision: nil + t.datetime "reviewed_at" t.boolean "review_passed" t.string "review_note", default: "", null: false t.datetime "requested_at" @@ -335,7 +335,7 @@ t.datetime "created_at", null: false t.datetime "updated_at", null: false t.boolean "review_passed" - t.datetime "reviewed_at", precision: nil + t.datetime "reviewed_at" t.boolean "contact_response" t.string "contact_name", default: "", null: false t.string "contact_job", default: "", null: false @@ -377,12 +377,12 @@ t.string "status_information", default: "", null: false t.string "sanction_information", default: "", null: false t.boolean "teaching_authority_provides_written_statement", default: false, null: false - t.boolean "application_form_skip_work_history", default: false, null: false t.text "qualifications_information", default: "", null: false + t.boolean "application_form_skip_work_history", default: false, null: false t.boolean "reduced_evidence_accepted", default: false, null: false t.boolean "teaching_authority_requires_submission_email", default: false, null: false - t.boolean "written_statement_optional", default: false, null: false t.boolean "requires_preliminary_check", default: false, null: false + t.boolean "written_statement_optional", default: false, null: false t.index ["country_id", "name"], name: "index_regions_on_country_id_and_name", unique: true t.index ["country_id"], name: "index_regions_on_country_id" end @@ -439,9 +439,9 @@ t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "invitation_token" - t.datetime "invitation_created_at", precision: nil - t.datetime "invitation_sent_at", precision: nil - t.datetime "invitation_accepted_at", precision: nil + t.datetime "invitation_created_at" + t.datetime "invitation_sent_at" + t.datetime "invitation_accepted_at" t.integer "invitation_limit" t.string "invited_by_type" t.bigint "invited_by_id" @@ -469,8 +469,8 @@ t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "sign_in_count", default: 0, null: false - t.datetime "current_sign_in_at", precision: nil - t.datetime "last_sign_in_at", precision: nil + t.datetime "current_sign_in_at" + t.datetime "last_sign_in_at" t.string "current_sign_in_ip" t.string "last_sign_in_ip" t.string "trn"