From 574d281cf6b3935693ef742c8bce84d18a4d15b0 Mon Sep 17 00:00:00 2001 From: Aga Dufrat Date: Tue, 19 Jul 2022 09:04:36 +0100 Subject: [PATCH 01/10] Update rails_translation_manager dependencies --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e652e005f..0eb16239e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -148,7 +148,7 @@ GEM http-accept (1.7.0) http-cookie (1.0.5) domain_name (~> 0.5) - i18n (1.11.0) + i18n (1.12.0) concurrent-ruby (~> 1.0) i18n-coverage (0.2.0) i18n-tasks (1.0.11) @@ -238,9 +238,9 @@ GEM nokogiri (>= 1.6) rails-html-sanitizer (1.4.3) loofah (~> 2.3) - rails-i18n (6.0.0) + rails-i18n (7.0.5) i18n (>= 0.7, < 2) - railties (>= 6.0.0, < 7) + railties (>= 6.0.0, < 8) rails_translation_manager (1.5.2) activesupport csv (~> 3.2) From 694134eb0e0b876e8cfb266ed2d40e573248ab46 Mon Sep 17 00:00:00 2001 From: Aga Dufrat Date: Mon, 18 Jul 2022 14:14:47 +0100 Subject: [PATCH 02/10] Remove :many translations for hr and sr The validate_locales test failed with Expected: [:few, :one, :other], actual: [:few, :many, :one, :other] --- config/locales/hr.yml | 76 ------------------------------------------- config/locales/sr.yml | 76 ------------------------------------------- 2 files changed, 152 deletions(-) diff --git a/config/locales/hr.yml b/config/locales/hr.yml index 6ca101edd..4fcfe99aa 100644 --- a/config/locales/hr.yml +++ b/config/locales/hr.yml @@ -67,377 +67,302 @@ hr: schema_name: aaib_report: few: - many: one: Izvješće podružnice za istraživanje zračnih nesreća other: Izvješća Podružnice za istraživanje zračnih nesreća announcement: few: - many: one: Obavijest other: Obavijesti asylum_support_decision: few: - many: one: Odluka tribunala o azilu other: Odluke tribunala o azilu authored_article: few: - many: one: Autorski članak other: Autorski članci business_finance_support_scheme: few: - many: one: Shema potpore poslovnom financiranju other: Sheme potpore poslovnom financiranju case_study: few: - many: one: Studija slučaja other: Studije slučaja closed_consultation: few: - many: one: Zatvorena konzultacija other: Zatvorene konzultacije cma_case: few: - many: one: Slučaj tijela za tržišno natjecanje i tržišta other: Slučajevi tijela za tržišno natjecanje i tržišta coming_soon: few: - many: one: Dolazi uskoro other: Dolazi uskoro consultation: few: - many: one: Konzultacija other: Konzultacije consultation_outcome: few: - many: one: Ishod konzultacija other: Ishodi konzultacija corporate_information_page: few: - many: one: Stranica s informacijama other: Stranice s informacijama corporate_report: few: - many: one: Korporativno izvješće other: Korporativna izvješća correspondence: few: - many: one: Prepiska other: Prepiske countryside_stewardship_grant: few: - many: one: Potpora za upravu na selu other: Potpore za upravu na selu decision: few: - many: one: Odluka other: Odluke detailed_guide: few: - many: one: Upute other: Upute dfid_research_output: few: - many: one: Istraživanje za razvojni rezultat other: Istraživanje za razvojne rezultate document_collection: few: - many: one: Kolekcija other: Kolekcije draft_text: few: - many: one: Nacrt teksta other: Nacrt tekstova drug_safety_update: few: - many: one: Novost o sigurnosti lijekova other: Novosti o sigurnosti lijekova employment_appeal_tribunal_decision: few: - many: one: Odluka žalbenog suda pri zapošljavanju other: Odluke žalbenog suda pri zapošljavanju employment_tribunal_decision: few: - many: one: Odluka suda za zapošljavanje other: Odluke suda za zapošljavanje esi_fund: few: - many: one: Europski strukturni i investicijski fond (ESIF) other: Europski strukturni i investicijski fondovi (ESIF) fatality_notice: few: - many: one: Obavijest o smrtnom slučaju other: Obavijest o smrtnim slučajevima foi_release: few: - many: one: Izdanje slobode informacija other: Izdanje slobode informacija form: few: - many: one: Obrazac other: Obrasci government_response: few: - many: one: Odgovor vlade other: Odgovori vlade guidance: few: - many: one: Upute other: Upute impact_assessment: few: - many: one: Procjena utjecaja other: Procjene utjecaja imported: few: - many: one: uvezeno - čekajući tip other: uvezeno - čekajući tip independent_report: few: - many: one: Nezavisno izvješće other: Nezavisna izvješća international_development_fund: few: - many: one: Financiranje međunarodnog razvoja other: Financiranje međunarodnog razvoja international_treaty: few: - many: one: Međunarodni ugovor other: Međunarodni ugovori maib_report: few: - many: one: Izvješće Podružnice za istraživanje pomorskih nesreća other: Izvješća Podružnice za istraživanje pomorskih nesreća map: few: - many: one: Karta other: Karte medical_safety_alert: few: - many: one: Upozorenja i opozivi za lijekove i medicinska sredstva other: Upozorenja i opozivi za lijekove i medicinska sredstva national: few: - many: one: Najava nacionalne statistike other: Najave nacionalne statistike national_statistics: few: - many: one: Nacionalna statistika other: Nacionalna statistika national_statistics_announcement: few: - many: one: Najava nacionalne statistike other: Najave nacionalne statistike news_article: few: - many: one: Novinski članak other: Novinski članci news_story: few: - many: one: Novosti other: Novosti notice: few: - many: one: Obavijest other: Obavijesti official: few: - many: one: Objava službene statistike other: Objave službene statistike official_statistics: few: - many: one: Službena statistika other: Službena statistika official_statistics_announcement: few: - many: one: Objava službene statistike other: Objave službene statistike open_consultation: few: - many: one: Otvorena konzultacija other: Otvorene konzultacije oral_statement: few: - many: one: Usmena izjava Parlamentu other: Usmene izjave Parlamentu policy: few: - many: one: Pravilo other: Pravila policy_paper: few: - many: one: Dokument o pravilima other: Dokumenti o pravilima press_release: few: - many: one: Saopćenje za javnost other: Saopćenja za javnost product-safety-alert-report-recall: few: - many: one: other: promotional: few: - many: one: Promidžbeni materijal other: Promidžbeni materijal publication: few: - many: one: Izdanja other: Izdanje raib_report: few: - many: one: Izvješće podružnice za istraživanje željezničkih nesreća other: Izvješća podružnice za istraživanje željezničkih nesreća regulation: few: - many: one: Regulacija other: Regulacije research: few: - many: one: Istraživanje i analiza other: Istraživanje i analiza residential_property_tribunal_decision: few: - many: one: Odluka suda stambene imovine other: Odluke suda stambene imovine service_sign_in: few: - many: one: Prijava na uslugu other: Prijava na uslugu service_standard_report: few: - many: one: Standardno izvješće usluge other: Standardna izvješća usluge speaking_notes: few: - many: one: Govorne bilješke other: Govorne bilješke speech: few: - many: one: Govor other: Govori standard: few: - many: one: Standard other: Standardi statement_to_parliament: few: - many: one: Izjava Parlamentu other: Izjave Parlamentu statistical_data_set: few: - many: one: Skup statističkih podataka other: Skupovi statističkih podataka statistics_announcement: few: - many: one: Najava objavljivanja statistike other: Najave objavljivanja statistike statutory_guidance: few: - many: one: Zakonske smjernice other: Zakonske smjernice take_part: few: - many: one: Sudjelovati other: Sudjelovati tax_tribunal_decision: few: - many: one: Odluka tribunala i poreznog suda other: Odluke tribunala i poreznog suda transcript: few: - many: one: Prijepis other: Prijepisi transparency: few: - many: one: Podaci o transparentnosti other: Podaci o transparentnosti utaac_decision: few: - many: one: Odluka upravnog žalbenog suda other: Odluke upravnog žalbenog suda world_location_news_article: few: - many: one: Novinski članak other: Novinski članci world_news_story: few: - many: one: Vijest iz svijeta other: Vijesti iz svijeta written_statement: few: - many: one: Pismena izjava Parlamentu other: Pismene izjave Parlamentu corporate_information_page: @@ -603,7 +528,6 @@ hr: details: Detalji documents: few: - many: one: Dokument other: Dokumenti service_sign_in: diff --git a/config/locales/sr.yml b/config/locales/sr.yml index 37b261b5c..546d4f9a1 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -67,377 +67,302 @@ sr: schema_name: aaib_report: few: - many: one: Izveštaj Agencije istragu vazduhoplovnih nesreća other: Izveštaji Agencije istragu vazduhoplovnih nesreća announcement: few: - many: one: Najava other: Najave asylum_support_decision: few: - many: one: Odluka tribunala za podršku azilu other: Odluke tribunala za podršku azilu authored_article: few: - many: one: Autorski članak other: Autorski članci business_finance_support_scheme: few: - many: one: Šema podrške za poslovno finansiranje other: Šeme podrške za poslovno finansiranje case_study: few: - many: one: Studija slučaja other: Studije slučaja closed_consultation: few: - many: one: Zatvorena konsultacija other: Zatvorene konsultacije cma_case: few: - many: one: Predmet Nacionalnog tela za zaštitu konkurencije i tržišta other: Predmeti Nacionalnog tela za zaštitu konkurencije i tržišta coming_soon: few: - many: one: Uskoro other: Uskoro consultation: few: - many: one: Konsultacija other: Konsultacije consultation_outcome: few: - many: one: Ishod konsultacija other: Ishodi konsultacija corporate_information_page: few: - many: one: Stranica sa informacijama other: Stranice sa informacijama corporate_report: few: - many: one: Organizacioni izveštaj other: Organizacioni izveštaji correspondence: few: - many: one: Prepiska other: Prepiske countryside_stewardship_grant: few: - many: one: Grant za upravljanje poljoprivrednim gazdinstvom other: Grantovi za upravljanje poljoprivrednim gazdinstvom decision: few: - many: one: Odluka other: Odluke detailed_guide: few: - many: one: Detaljno uputstvo other: Detaljno uputstvo dfid_research_output: few: - many: one: Istraživanje za krajnji cilj razvoja other: Istraživanje za krajnji ciljeve razvoja document_collection: few: - many: one: Kolekcija other: Kolekcije draft_text: few: - many: one: Radna verzija teksta other: Radne verzije teksta drug_safety_update: few: - many: one: Obaveštenje o bezbednosti lekova other: Obaveštenja o bezbednosti lekova employment_appeal_tribunal_decision: few: - many: one: Odluka tribunala za žalbe u vezi sa zaposlenjem other: Odluke tribunala za žalbe u vezi sa zaposlenjem employment_tribunal_decision: few: - many: one: Odluka tribunala za zaposlenje other: Odluke tribunala za zaposlenje esi_fund: few: - many: one: Evropski strukturni i investicioni fond (ESIF) other: Evropski strukturni i investicioni fondovi (ESIF) fatality_notice: few: - many: one: Obaveštenje o smrtnim slučajevima other: Obaveštenja o smrtnim slučajevima foi_release: few: - many: one: Odgovor na zahtev za pristup informacijama od javnog značaja other: Odgovori na zahteve za pristup informacijama od javnog značaja form: few: - many: one: Formular other: Obrasci government_response: few: - many: one: Odgovor vlade other: Odgovori vlade guidance: few: - many: one: Detaljno uputstvo other: Detaljno uputstvo impact_assessment: few: - many: one: Procena efekta other: Procene efekata imported: few: - many: one: uvezeno – utvrđivanje tipa other: uvezeno – utvrđivanje tipa independent_report: few: - many: one: Nezavisni izveštaj other: Nezavisni izveštaji international_development_fund: few: - many: one: Međunarodni fond za razvoj other: Međunarodni fond za razvoj international_treaty: few: - many: one: Međunarodni sporazum other: Međunarodni sporazumi maib_report: few: - many: one: Izveštaj Agencije istragu pomorskih nesreća other: Izveštaji Agencije istragu pomorskih nesreća map: few: - many: one: Mapa other: Mape medical_safety_alert: few: - many: one: Upozorenja i zahtevi za opoziv za lekove i medicinska sredstva other: Upozorenja i zahtevi za opoziv za lekove i medicinska sredstva national: few: - many: one: Najava državne statistike other: Najave državne statistike national_statistics: few: - many: one: Državna statistika other: Državna statistika national_statistics_announcement: few: - many: one: Najava državne statistike other: Najave državne statistike news_article: few: - many: one: Članak vesti other: Članci vesti news_story: few: - many: one: Vest other: Vesti notice: few: - many: one: Obaveštenje other: Obaveštenja official: few: - many: one: Izjava zvanične statistike other: Izjave zvanične statistike official_statistics: few: - many: one: Zvanična statistika other: Zvanična statistika official_statistics_announcement: few: - many: one: Izjava zvanične statistike other: Izjave zvanične statistike open_consultation: few: - many: one: Otvorena konsultacija other: Otvorene konsultacije oral_statement: few: - many: one: Usmeno obraćanje Parlamentu other: Usmena obraćanja Parlamentu policy: few: - many: one: Politika other: Politike policy_paper: few: - many: one: Predlog politike other: Predlozi politike press_release: few: - many: one: Saopštenje za medije other: Saopštenja za štampu product-safety-alert-report-recall: few: - many: one: other: promotional: few: - many: one: Promotivni materijal other: Promotivni materijal publication: few: - many: one: Publikacija other: Publikacije raib_report: few: - many: one: Izveštaj Agencije istragu železničkih nesreća other: Izveštaji Agencije istragu železničkih nesreća regulation: few: - many: one: Propis other: Propisi research: few: - many: one: Istraživanje i analiza other: Istraživanje i analiza residential_property_tribunal_decision: few: - many: one: Odluka tribunala o imovini rezidenta other: Odluke tribunala o imovini rezidenata service_sign_in: few: - many: one: Prijava u uslugu other: Prijava u uslugu service_standard_report: few: - many: one: Izveštaj o standardu usluge other: Izveštaji o standardu usluge speaking_notes: few: - many: one: Teze za govor other: Teze za govor speech: few: - many: one: Govor other: Govori standard: few: - many: one: Standard other: Standardi statement_to_parliament: few: - many: one: Obraćanje Parlamentu other: Obraćanja Parlamentu statistical_data_set: few: - many: one: Set statističkih podataka other: Setovi statističkih podataka statistics_announcement: few: - many: one: Saopštenje o objavljenim statističkim podacima other: Saopštenja o objavljenim statističkim podacima statutory_guidance: few: - many: one: Zakonska uputstva other: Zakonska uputstva take_part: few: - many: one: Učešće other: Učešće tax_tribunal_decision: few: - many: one: Odluka tribunala o porezima i državnoj upravi other: Odluke tribunala o porezima i državnoj upravi transcript: few: - many: one: Transkript other: Transkripti transparency: few: - many: one: Podaci o transparentnosti other: Podaci o transparentnosti utaac_decision: few: - many: one: Odluka tribunala za administrativne žalbe other: Odluke tribunala za administrativne žalbe world_location_news_article: few: - many: one: Članak vesti other: Članci vesti world_news_story: few: - many: one: Vest iz sveta other: Vesti iz sveta written_statement: few: - many: one: Pismena predstavka Parlamentu other: Pismene predstavke Parlamentu corporate_information_page: @@ -603,7 +528,6 @@ sr: details: Detalji documents: few: - many: one: Dokument other: Dokumenti service_sign_in: From eab3d44d3e8fde376027a42a16365297c2db28f1 Mon Sep 17 00:00:00 2001 From: Aga Dufrat Date: Mon, 18 Jul 2022 12:46:20 +0100 Subject: [PATCH 03/10] Autoload HttpFeatureFlags in `to_prepare` block Autoloading during initialization will error in Rails 7. Applications that autoloaded reloadable constants during initialization outside of to_prepare blocks got those constants unloaded. https://guides.rubyonrails.org/v7.0/upgrading_ruby_on_rails.html#autoloading-during-initialization --- config/initializers/feature_flags.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/initializers/feature_flags.rb b/config/initializers/feature_flags.rb index 8c4e30726..5e9b0353b 100644 --- a/config/initializers/feature_flags.rb +++ b/config/initializers/feature_flags.rb @@ -4,4 +4,6 @@ def self.recommended_related_links end end -HttpFeatureFlags.instance.add_http_feature_flag(FeatureFlagNames.recommended_related_links, "true") +Rails.application.reloader.to_prepare do + HttpFeatureFlags.instance.add_http_feature_flag(FeatureFlagNames.recommended_related_links, "true") +end From e2acb5273795aafaa553c3c9fef556265cb85260 Mon Sep 17 00:00:00 2001 From: Aga Dufrat Date: Mon, 18 Jul 2022 12:51:27 +0100 Subject: [PATCH 04/10] Update to rails 7 with `rails app:update` --- Gemfile | 2 +- Gemfile.lock | 137 ++++++++++-------- bin/rails | 6 +- bin/rake | 4 +- bin/setup | 18 +-- config/application.rb | 1 - config/environments/development.rb | 24 +-- config/environments/production.rb | 42 ++---- config/environments/test.rb | 18 ++- config/initializers/assets.rb | 8 + .../initializers/filter_parameter_logging.rb | 8 +- config/initializers/inflections.rb | 8 +- .../new_framework_defaults_7_0.rb | 117 +++++++++++++++ config/initializers/permissions_policy.rb | 11 ++ 14 files changed, 280 insertions(+), 124 deletions(-) create mode 100644 config/initializers/new_framework_defaults_7_0.rb create mode 100644 config/initializers/permissions_policy.rb diff --git a/Gemfile b/Gemfile index 2bc498472..138fc04a4 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source "https://rubygems.org" -gem "rails", "6.1.6.1" +gem "rails", "7.0.3.1" gem "dalli" gem "gds-api-adapters" diff --git a/Gemfile.lock b/Gemfile.lock index 0eb16239e..97c86294c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,65 +1,71 @@ GEM remote: https://rubygems.org/ specs: - actioncable (6.1.6.1) - actionpack (= 6.1.6.1) - activesupport (= 6.1.6.1) + actioncable (7.0.3.1) + actionpack (= 7.0.3.1) + activesupport (= 7.0.3.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.6.1) - actionpack (= 6.1.6.1) - activejob (= 6.1.6.1) - activerecord (= 6.1.6.1) - activestorage (= 6.1.6.1) - activesupport (= 6.1.6.1) + actionmailbox (7.0.3.1) + actionpack (= 7.0.3.1) + activejob (= 7.0.3.1) + activerecord (= 7.0.3.1) + activestorage (= 7.0.3.1) + activesupport (= 7.0.3.1) mail (>= 2.7.1) - actionmailer (6.1.6.1) - actionpack (= 6.1.6.1) - actionview (= 6.1.6.1) - activejob (= 6.1.6.1) - activesupport (= 6.1.6.1) + net-imap + net-pop + net-smtp + actionmailer (7.0.3.1) + actionpack (= 7.0.3.1) + actionview (= 7.0.3.1) + activejob (= 7.0.3.1) + activesupport (= 7.0.3.1) mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp rails-dom-testing (~> 2.0) - actionpack (6.1.6.1) - actionview (= 6.1.6.1) - activesupport (= 6.1.6.1) - rack (~> 2.0, >= 2.0.9) + actionpack (7.0.3.1) + actionview (= 7.0.3.1) + activesupport (= 7.0.3.1) + rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.6.1) - actionpack (= 6.1.6.1) - activerecord (= 6.1.6.1) - activestorage (= 6.1.6.1) - activesupport (= 6.1.6.1) + actiontext (7.0.3.1) + actionpack (= 7.0.3.1) + activerecord (= 7.0.3.1) + activestorage (= 7.0.3.1) + activesupport (= 7.0.3.1) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.6.1) - activesupport (= 6.1.6.1) + actionview (7.0.3.1) + activesupport (= 7.0.3.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.6.1) - activesupport (= 6.1.6.1) + activejob (7.0.3.1) + activesupport (= 7.0.3.1) globalid (>= 0.3.6) - activemodel (6.1.6.1) - activesupport (= 6.1.6.1) - activerecord (6.1.6.1) - activemodel (= 6.1.6.1) - activesupport (= 6.1.6.1) - activestorage (6.1.6.1) - actionpack (= 6.1.6.1) - activejob (= 6.1.6.1) - activerecord (= 6.1.6.1) - activesupport (= 6.1.6.1) + activemodel (7.0.3.1) + activesupport (= 7.0.3.1) + activerecord (7.0.3.1) + activemodel (= 7.0.3.1) + activesupport (= 7.0.3.1) + activestorage (7.0.3.1) + actionpack (= 7.0.3.1) + activejob (= 7.0.3.1) + activerecord (= 7.0.3.1) + activesupport (= 7.0.3.1) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.6.1) + activesupport (7.0.3.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) ansi (1.5.0) @@ -98,6 +104,7 @@ GEM csv (3.2.3) dalli (2.7.10) debug_inspector (0.0.3) + digest (3.1.0) docile (1.3.2) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) @@ -191,6 +198,20 @@ GEM minitest (>= 5.0) ruby-progressbar mocha (1.11.2) + net-imap (0.2.3) + digest + net-protocol + strscan + net-pop (0.1.1) + digest + net-protocol + timeout + net-protocol (0.1.3) + timeout + net-smtp (0.3.1) + digest + net-protocol + timeout netrc (0.11.0) nio4r (2.5.8) nokogiri (1.13.7) @@ -214,21 +235,20 @@ GEM rack-test (2.0.2) rack (>= 1.3) rack_strip_client_ip (0.0.2) - rails (6.1.6.1) - actioncable (= 6.1.6.1) - actionmailbox (= 6.1.6.1) - actionmailer (= 6.1.6.1) - actionpack (= 6.1.6.1) - actiontext (= 6.1.6.1) - actionview (= 6.1.6.1) - activejob (= 6.1.6.1) - activemodel (= 6.1.6.1) - activerecord (= 6.1.6.1) - activestorage (= 6.1.6.1) - activesupport (= 6.1.6.1) + rails (7.0.3.1) + actioncable (= 7.0.3.1) + actionmailbox (= 7.0.3.1) + actionmailer (= 7.0.3.1) + actionpack (= 7.0.3.1) + actiontext (= 7.0.3.1) + actionview (= 7.0.3.1) + activejob (= 7.0.3.1) + activemodel (= 7.0.3.1) + activerecord (= 7.0.3.1) + activestorage (= 7.0.3.1) + activesupport (= 7.0.3.1) bundler (>= 1.15.0) - railties (= 6.1.6.1) - sprockets-rails (>= 2.0.0) + railties (= 7.0.3.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -246,12 +266,13 @@ GEM csv (~> 3.2) i18n-tasks rails-i18n - railties (6.1.6.1) - actionpack (= 6.1.6.1) - activesupport (= 6.1.6.1) + railties (7.0.3.1) + actionpack (= 7.0.3.1) + activesupport (= 7.0.3.1) method_source rake (>= 12.2) thor (~> 1.0) + zeitwerk (~> 2.5) rainbow (3.1.1) raindrops (0.20.0) rake (13.0.6) @@ -333,11 +354,13 @@ GEM activesupport (>= 5.2) sprockets (>= 3.0.0) statsd-ruby (1.5.0) + strscan (3.0.3) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) thor (1.2.1) tilt (2.0.10) timecop (0.9.4) + timeout (0.3.0) tzinfo (2.0.4) concurrent-ruby (~> 1.0) uglifier (4.2.0) @@ -385,7 +408,7 @@ DEPENDENCIES plek pry rack_strip_client_ip - rails (= 6.1.6.1) + rails (= 7.0.3.1) rails-controller-testing rails-i18n rails_translation_manager diff --git a/bin/rails b/bin/rails index 073966023..efc037749 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,4 @@ #!/usr/bin/env ruby -APP_PATH = File.expand_path('../config/application', __dir__) -require_relative '../config/boot' -require 'rails/commands' +APP_PATH = File.expand_path("../config/application", __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/bin/rake b/bin/rake index 17240489f..4fbf10b96 100755 --- a/bin/rake +++ b/bin/rake @@ -1,4 +1,4 @@ #!/usr/bin/env ruby -require_relative '../config/boot' -require 'rake' +require_relative "../config/boot" +require "rake" Rake.application.run diff --git a/bin/setup b/bin/setup index 2e29ac1c3..57b65c85d 100755 --- a/bin/setup +++ b/bin/setup @@ -1,25 +1,25 @@ #!/usr/bin/env ruby -require 'fileutils' +require "fileutils" # path to your application root. -APP_ROOT = File.expand_path('..', __dir__) +APP_ROOT = File.expand_path("..", __dir__) def system!(*args) system(*args) || abort("\n== Command #{args} failed ==") end FileUtils.chdir APP_ROOT do - # This script is a way to setup or update your development environment automatically. - # This script is idempotent, so that you can run it at anytime and get an expectable outcome. + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. # Add necessary setup steps to this file. - puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' - system('bundle check') || system!('bundle install') + puts "== Installing dependencies ==" + system! "gem install bundler --conservative" + system("bundle check") || system!("bundle install") puts "\n== Removing old logs and tempfiles ==" - system! 'bin/rails log:clear tmp:clear' + system! "bin/rails log:clear tmp:clear" puts "\n== Restarting application server ==" - system! 'bin/rails restart' + system! "bin/rails restart" end diff --git a/config/application.rb b/config/application.rb index 136fc62b5..93df3e2ea 100644 --- a/config/application.rb +++ b/config/application.rb @@ -12,7 +12,6 @@ # require "action_text/engine" require "action_view/railtie" # require "action_cable/engine" -require "sprockets/railtie" require "rails/test_unit/railtie" # Require the gems listed in Gemfile, including any gems diff --git a/config/environments/development.rb b/config/environments/development.rb index c914d23d2..fbf8292a4 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -3,8 +3,8 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development + # In the development environment your application's code is reloaded any time + # it changes. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. config.cache_classes = false @@ -14,6 +14,9 @@ # Show full error reports. config.consider_all_requests_local = true + # Enable server timing + config.server_timing = true + # Enable/disable caching. By default caching is disabled. # Run rails dev:cache to toggle caching. if Rails.root.join("tmp/caching-dev.txt").exist? @@ -33,10 +36,11 @@ # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log - # Debug mode disables concatenation and preprocessing of assets. - # This option may cause significant delays in view rendering with a large - # number of complex assets. - config.assets.debug = true + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] # Suppress logger output for asset requests. config.assets.quiet = true @@ -44,9 +48,11 @@ # Raises error for missing translations. config.i18n.raise_on_missing_translations = true - # Use an evented file watcher to asynchronously detect changes in source code, - # routes, locales, etc. This feature depends on the listen gem. - # config.file_watcher = ActiveSupport::EventedFileUpdateChecker + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true config.hosts.clear + + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true end diff --git a/config/environments/production.rb b/config/environments/production.rb index 50eea2c7a..a6d556b67 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -38,24 +38,23 @@ config.sass.line_comments = false # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = 'http://assets.example.com' + # config.asset_host = "http://assets.example.com" # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache + # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true - # Use the lowest log level to ensure availability of diagnostic information - # when problems arise. + # Include generic and useful information about system operation, but avoid logging too much + # information to avoid inadvertent exposure of personally identifiable information (PII). config.log_level = :info # Prepend all log lines with the following tags. - # config.log_tags = [ :request_id ] + config.log_tags = [:request_id] # Use a different cache store in production. - # config.cache_store = :mem_cache_store config.cache_store = :mem_cache_store, nil, { namespace: :government_frontend, compress: true } # Use a real queuing backend for Active Job (and separate queues per environment). @@ -66,40 +65,19 @@ # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true - # Send deprecation notices to registered listeners. - config.active_support.deprecation = :notify + # Don't log any deprecations. + config.active_support.report_deprecations = false # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new # Use a different logger for distributed setups. - # require 'syslog/logger' - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') + # require "syslog/logger" + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") if ENV["RAILS_LOG_TO_STDOUT"].present? logger = ActiveSupport::Logger.new($stdout) logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new(logger) end - - # Inserts middleware to perform automatic connection switching. - # The `database_selector` hash is used to pass options to the DatabaseSelector - # middleware. The `delay` is used to determine how long to wait after a write - # to send a subsequent read to the primary. - # - # The `database_resolver` class is used by the middleware to determine which - # database is appropriate to use based on the time delay. - # - # The `database_resolver_context` class is used by the middleware to set - # timestamps for the last write to the primary. The resolver uses the context - # class timestamps to determine how long to wait before reading from the - # replica. - # - # By default Rails will store a last write timestamp in the session. The - # DatabaseSelector middleware is designed as such you can define your own - # strategy for connection switching and pass that into the middleware through - # these configuration options. - # config.active_record.database_selector = { delay: 2.seconds } - # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver - # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session end diff --git a/config/environments/test.rb b/config/environments/test.rb index 13eb04da9..69f182cd2 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -8,12 +8,13 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. + # Turn false under Spring and add config.action_view.cache_template_loading = true. config.cache_classes = true - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false + # Eager loading loads your whole application. When running a single test locally, + # this probably isn't necessary. It's a good idea to do in a continuous integration + # system, or in some way before deploying your code. + config.eager_load = ENV["CI"].present? # Configure public file server for tests with Cache-Control for performance. config.public_file_server.enabled = true @@ -35,6 +36,12 @@ # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + # Raises error for missing translations. config.i18n.raise_on_missing_translations = true @@ -44,4 +51,7 @@ # javascript before tests run. Meaning failing JS will not be detected # in integration tests. config.assets.digest = false + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true end diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 25edcd213..454d31412 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -2,3 +2,11 @@ # Version of your assets, change this if you want to expire all your assets. Rails.application.config.assets.version = "1.0" + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in the app/assets +# folder are already added. +# Rails.application.config.assets.precompile += %w[webchat/library.js webchat.js] diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index 4a994e1e7..166997c5a 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -1,4 +1,8 @@ # Be sure to restart your server when you modify this file. -# Configure sensitive parameters which will be filtered from the log file. -Rails.application.config.filter_parameters += [:password] +# Configure parameters to be filtered from the log file. Use this to limit dissemination of +# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported +# notations and behaviors. +Rails.application.config.filter_parameters += %i[ + passw secret token _key crypt salt certificate otp ssn +] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index ac033bf9d..3860f659e 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -4,13 +4,13 @@ # are locale specific, and you may define rules for as many different # locales as you wish. All of these examples are active by default: # ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' +# inflect.plural /^(ox)$/i, "\\1en" +# inflect.singular /^(ox)en/i, "\\1" +# inflect.irregular "person", "people" # inflect.uncountable %w( fish sheep ) # end # These inflection rules are supported but not enabled by default: # ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.acronym 'RESTful' +# inflect.acronym "RESTful" # end diff --git a/config/initializers/new_framework_defaults_7_0.rb b/config/initializers/new_framework_defaults_7_0.rb new file mode 100644 index 000000000..a579326e2 --- /dev/null +++ b/config/initializers/new_framework_defaults_7_0.rb @@ -0,0 +1,117 @@ +# Be sure to restart your server when you modify this file. +# +# This file eases your Rails 7.0 framework defaults upgrade. +# +# Uncomment each configuration one by one to switch to the new default. +# Once your application is ready to run with all new defaults, you can remove +# this file and set the `config.load_defaults` to `7.0`. +# +# Read the Guide for Upgrading Ruby on Rails for more info on each option. +# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html + +# `button_to` view helper will render `