Browse Source

[rails] Upgrade to Rails 8. (#9446)

Petrik de Heus 8 months ago
parent
commit
6d43b7efb5

+ 1 - 1
frameworks/Ruby/rails/Gemfile

@@ -1,6 +1,6 @@
 source 'https://rubygems.org'
 source 'https://rubygems.org'
 
 
-gem 'rails', '~> 7.2.0'
+gem 'rails', '~> 8.0.0'
 gem 'redis', '~> 5.0'
 gem 'redis', '~> 5.0'
 gem 'tzinfo-data'
 gem 'tzinfo-data'
 
 

+ 89 - 86
frameworks/Ruby/rails/Gemfile.lock

@@ -1,67 +1,67 @@
 GEM
 GEM
   remote: https://rubygems.org/
   remote: https://rubygems.org/
   specs:
   specs:
-    actioncable (7.2.1.1)
-      actionpack (= 7.2.1.1)
-      activesupport (= 7.2.1.1)
+    actioncable (8.0.0)
+      actionpack (= 8.0.0)
+      activesupport (= 8.0.0)
       nio4r (~> 2.0)
       nio4r (~> 2.0)
       websocket-driver (>= 0.6.1)
       websocket-driver (>= 0.6.1)
       zeitwerk (~> 2.6)
       zeitwerk (~> 2.6)
-    actionmailbox (7.2.1.1)
-      actionpack (= 7.2.1.1)
-      activejob (= 7.2.1.1)
-      activerecord (= 7.2.1.1)
-      activestorage (= 7.2.1.1)
-      activesupport (= 7.2.1.1)
+    actionmailbox (8.0.0)
+      actionpack (= 8.0.0)
+      activejob (= 8.0.0)
+      activerecord (= 8.0.0)
+      activestorage (= 8.0.0)
+      activesupport (= 8.0.0)
       mail (>= 2.8.0)
       mail (>= 2.8.0)
-    actionmailer (7.2.1.1)
-      actionpack (= 7.2.1.1)
-      actionview (= 7.2.1.1)
-      activejob (= 7.2.1.1)
-      activesupport (= 7.2.1.1)
+    actionmailer (8.0.0)
+      actionpack (= 8.0.0)
+      actionview (= 8.0.0)
+      activejob (= 8.0.0)
+      activesupport (= 8.0.0)
       mail (>= 2.8.0)
       mail (>= 2.8.0)
       rails-dom-testing (~> 2.2)
       rails-dom-testing (~> 2.2)
-    actionpack (7.2.1.1)
-      actionview (= 7.2.1.1)
-      activesupport (= 7.2.1.1)
+    actionpack (8.0.0)
+      actionview (= 8.0.0)
+      activesupport (= 8.0.0)
       nokogiri (>= 1.8.5)
       nokogiri (>= 1.8.5)
-      racc
-      rack (>= 2.2.4, < 3.2)
+      rack (>= 2.2.4)
       rack-session (>= 1.0.1)
       rack-session (>= 1.0.1)
       rack-test (>= 0.6.3)
       rack-test (>= 0.6.3)
       rails-dom-testing (~> 2.2)
       rails-dom-testing (~> 2.2)
       rails-html-sanitizer (~> 1.6)
       rails-html-sanitizer (~> 1.6)
       useragent (~> 0.16)
       useragent (~> 0.16)
-    actiontext (7.2.1.1)
-      actionpack (= 7.2.1.1)
-      activerecord (= 7.2.1.1)
-      activestorage (= 7.2.1.1)
-      activesupport (= 7.2.1.1)
+    actiontext (8.0.0)
+      actionpack (= 8.0.0)
+      activerecord (= 8.0.0)
+      activestorage (= 8.0.0)
+      activesupport (= 8.0.0)
       globalid (>= 0.6.0)
       globalid (>= 0.6.0)
       nokogiri (>= 1.8.5)
       nokogiri (>= 1.8.5)
-    actionview (7.2.1.1)
-      activesupport (= 7.2.1.1)
+    actionview (8.0.0)
+      activesupport (= 8.0.0)
       builder (~> 3.1)
       builder (~> 3.1)
       erubi (~> 1.11)
       erubi (~> 1.11)
       rails-dom-testing (~> 2.2)
       rails-dom-testing (~> 2.2)
       rails-html-sanitizer (~> 1.6)
       rails-html-sanitizer (~> 1.6)
-    activejob (7.2.1.1)
-      activesupport (= 7.2.1.1)
+    activejob (8.0.0)
+      activesupport (= 8.0.0)
       globalid (>= 0.3.6)
       globalid (>= 0.3.6)
-    activemodel (7.2.1.1)
-      activesupport (= 7.2.1.1)
-    activerecord (7.2.1.1)
-      activemodel (= 7.2.1.1)
-      activesupport (= 7.2.1.1)
+    activemodel (8.0.0)
+      activesupport (= 8.0.0)
+    activerecord (8.0.0)
+      activemodel (= 8.0.0)
+      activesupport (= 8.0.0)
       timeout (>= 0.4.0)
       timeout (>= 0.4.0)
-    activestorage (7.2.1.1)
-      actionpack (= 7.2.1.1)
-      activejob (= 7.2.1.1)
-      activerecord (= 7.2.1.1)
-      activesupport (= 7.2.1.1)
+    activestorage (8.0.0)
+      actionpack (= 8.0.0)
+      activejob (= 8.0.0)
+      activerecord (= 8.0.0)
+      activesupport (= 8.0.0)
       marcel (~> 1.0)
       marcel (~> 1.0)
-    activesupport (7.2.1.1)
+    activesupport (8.0.0)
       base64
       base64
+      benchmark (>= 0.3)
       bigdecimal
       bigdecimal
       concurrent-ruby (~> 1.0, >= 1.3.1)
       concurrent-ruby (~> 1.0, >= 1.3.1)
       connection_pool (>= 2.2.5)
       connection_pool (>= 2.2.5)
@@ -71,14 +71,15 @@ GEM
       minitest (>= 5.1)
       minitest (>= 5.1)
       securerandom (>= 0.3)
       securerandom (>= 0.3)
       tzinfo (~> 2.0, >= 2.0.5)
       tzinfo (~> 2.0, >= 2.0.5)
+      uri (>= 0.13.1)
     agoo (2.15.13)
     agoo (2.15.13)
-    async (2.17.0)
-      console (~> 1.26)
+    async (2.19.0)
+      console (~> 1.29)
       fiber-annotation
       fiber-annotation
       io-event (~> 1.6, >= 1.6.5)
       io-event (~> 1.6, >= 1.6.5)
     async-container (0.18.3)
     async-container (0.18.3)
       async (~> 2.10)
       async (~> 2.10)
-    async-http (0.82.1)
+    async-http (0.82.3)
       async (>= 2.10.2)
       async (>= 2.10.2)
       async-pool (~> 0.9)
       async-pool (~> 0.9)
       io-endpoint (~> 0.14)
       io-endpoint (~> 0.14)
@@ -97,16 +98,17 @@ GEM
       async
       async
       async-container (~> 0.16)
       async-container (~> 0.16)
     base64 (0.2.0)
     base64 (0.2.0)
+    benchmark (0.4.0)
     bigdecimal (3.1.8)
     bigdecimal (3.1.8)
     builder (3.3.0)
     builder (3.3.0)
     concurrent-ruby (1.3.4)
     concurrent-ruby (1.3.4)
     connection_pool (2.4.1)
     connection_pool (2.4.1)
-    console (1.27.0)
+    console (1.29.0)
       fiber-annotation
       fiber-annotation
       fiber-local (~> 1.1)
       fiber-local (~> 1.1)
       json
       json
     crass (1.0.6)
     crass (1.0.6)
-    date (3.3.4)
+    date (3.4.1)
     drb (2.2.1)
     drb (2.2.1)
     erubi (1.13.0)
     erubi (1.13.0)
     falcon (0.48.3)
     falcon (0.48.3)
@@ -130,16 +132,16 @@ GEM
       activesupport (>= 6.1)
       activesupport (>= 6.1)
     i18n (1.14.6)
     i18n (1.14.6)
       concurrent-ruby (~> 1.0)
       concurrent-ruby (~> 1.0)
-    io-console (0.7.2)
+    io-console (0.8.0)
     io-endpoint (0.14.0)
     io-endpoint (0.14.0)
-    io-event (1.7.2)
-    io-stream (0.6.0)
+    io-event (1.7.3)
+    io-stream (0.6.1)
     irb (1.14.1)
     irb (1.14.1)
       rdoc (>= 4.0.0)
       rdoc (>= 4.0.0)
       reline (>= 0.4.2)
       reline (>= 0.4.2)
     json (2.8.1)
     json (2.8.1)
     localhost (1.3.1)
     localhost (1.3.1)
-    logger (1.6.1)
+    logger (1.6.2)
     loofah (2.23.1)
     loofah (2.23.1)
       crass (~> 1.0.2)
       crass (~> 1.0.2)
       nokogiri (>= 1.12.0)
       nokogiri (>= 1.12.0)
@@ -150,11 +152,11 @@ GEM
       net-smtp
       net-smtp
     mapping (1.1.1)
     mapping (1.1.1)
     marcel (1.0.4)
     marcel (1.0.4)
-    metrics (0.12.0)
+    metrics (0.12.1)
     mini_mime (1.1.5)
     mini_mime (1.1.5)
     mini_portile2 (2.8.8)
     mini_portile2 (2.8.8)
-    minitest (5.25.1)
-    net-imap (0.4.17)
+    minitest (5.25.4)
+    net-imap (0.5.1)
       date
       date
       net-protocol
       net-protocol
     net-pop (0.1.2)
     net-pop (0.1.2)
@@ -167,27 +169,29 @@ GEM
     nokogiri (1.16.8)
     nokogiri (1.16.8)
       mini_portile2 (~> 2.8.2)
       mini_portile2 (~> 2.8.2)
       racc (~> 1.4)
       racc (~> 1.4)
-    nokogiri (1.16.8-arm64-darwin)
+    nokogiri (1.16.8-x86_64-darwin)
       racc (~> 1.4)
       racc (~> 1.4)
     nokogiri (1.16.8-x86_64-linux)
     nokogiri (1.16.8-x86_64-linux)
       racc (~> 1.4)
       racc (~> 1.4)
     openssl (3.2.0)
     openssl (3.2.0)
-    pg (1.5.8)
+    pg (1.5.9)
     process-metrics (0.3.0)
     process-metrics (0.3.0)
       console (~> 1.8)
       console (~> 1.8)
       json (~> 2)
       json (~> 2)
       samovar (~> 2.1)
       samovar (~> 2.1)
     protocol-hpack (1.5.1)
     protocol-hpack (1.5.1)
-    protocol-http (0.40.0)
+    protocol-http (0.42.0)
     protocol-http1 (0.28.1)
     protocol-http1 (0.28.1)
       protocol-http (~> 0.22)
       protocol-http (~> 0.22)
-    protocol-http2 (0.19.3)
+    protocol-http2 (0.19.4)
       protocol-hpack (~> 1.4)
       protocol-hpack (~> 1.4)
       protocol-http (~> 0.18)
       protocol-http (~> 0.18)
+      traces
     protocol-rack (0.10.1)
     protocol-rack (0.10.1)
       protocol-http (~> 0.37)
       protocol-http (~> 0.37)
       rack (>= 1.0)
       rack (>= 1.0)
-    psych (5.1.2)
+    psych (5.2.1)
+      date
       stringio
       stringio
     puma (6.5.0)
     puma (6.5.0)
       nio4r (~> 2.0)
       nio4r (~> 2.0)
@@ -197,23 +201,22 @@ GEM
       rack (>= 3.0.0)
       rack (>= 3.0.0)
     rack-test (2.1.0)
     rack-test (2.1.0)
       rack (>= 1.3)
       rack (>= 1.3)
-    rackup (2.1.0)
+    rackup (2.2.1)
       rack (>= 3)
       rack (>= 3)
-      webrick (~> 1.8)
-    rails (7.2.1.1)
-      actioncable (= 7.2.1.1)
-      actionmailbox (= 7.2.1.1)
-      actionmailer (= 7.2.1.1)
-      actionpack (= 7.2.1.1)
-      actiontext (= 7.2.1.1)
-      actionview (= 7.2.1.1)
-      activejob (= 7.2.1.1)
-      activemodel (= 7.2.1.1)
-      activerecord (= 7.2.1.1)
-      activestorage (= 7.2.1.1)
-      activesupport (= 7.2.1.1)
+    rails (8.0.0)
+      actioncable (= 8.0.0)
+      actionmailbox (= 8.0.0)
+      actionmailer (= 8.0.0)
+      actionpack (= 8.0.0)
+      actiontext (= 8.0.0)
+      actionview (= 8.0.0)
+      activejob (= 8.0.0)
+      activemodel (= 8.0.0)
+      activerecord (= 8.0.0)
+      activestorage (= 8.0.0)
+      activesupport (= 8.0.0)
       bundler (>= 1.15.0)
       bundler (>= 1.15.0)
-      railties (= 7.2.1.1)
+      railties (= 8.0.0)
     rails-dom-testing (2.2.0)
     rails-dom-testing (2.2.0)
       activesupport (>= 5.0.0)
       activesupport (>= 5.0.0)
       minitest
       minitest
@@ -221,46 +224,46 @@ GEM
     rails-html-sanitizer (1.6.1)
     rails-html-sanitizer (1.6.1)
       loofah (~> 2.21)
       loofah (~> 2.21)
       nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
       nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
-    railties (7.2.1.1)
-      actionpack (= 7.2.1.1)
-      activesupport (= 7.2.1.1)
+    railties (8.0.0)
+      actionpack (= 8.0.0)
+      activesupport (= 8.0.0)
       irb (~> 1.13)
       irb (~> 1.13)
       rackup (>= 1.0.0)
       rackup (>= 1.0.0)
       rake (>= 12.2)
       rake (>= 12.2)
       thor (~> 1.0, >= 1.2.2)
       thor (~> 1.0, >= 1.2.2)
       zeitwerk (~> 2.6)
       zeitwerk (~> 2.6)
     rake (13.2.1)
     rake (13.2.1)
-    rdoc (6.7.0)
+    rdoc (6.8.1)
       psych (>= 4.0.0)
       psych (>= 4.0.0)
     redis (5.3.0)
     redis (5.3.0)
       redis-client (>= 0.22.0)
       redis-client (>= 0.22.0)
     redis-client (0.22.2)
     redis-client (0.22.2)
       connection_pool
       connection_pool
-    reline (0.5.10)
+    reline (0.5.12)
       io-console (~> 0.5)
       io-console (~> 0.5)
     samovar (2.3.0)
     samovar (2.3.0)
       console (~> 1.0)
       console (~> 1.0)
       mapping (~> 1.0)
       mapping (~> 1.0)
-    securerandom (0.3.1)
-    stringio (3.1.1)
+    securerandom (0.4.0)
+    stringio (3.1.2)
     thor (1.3.2)
     thor (1.3.2)
-    timeout (0.4.1)
-    traces (0.13.1)
+    timeout (0.4.2)
+    traces (0.14.1)
     trilogy (2.8.1)
     trilogy (2.8.1)
     tzinfo (2.0.6)
     tzinfo (2.0.6)
       concurrent-ruby (~> 1.0)
       concurrent-ruby (~> 1.0)
     tzinfo-data (1.2024.2)
     tzinfo-data (1.2024.2)
       tzinfo (>= 1.0.0)
       tzinfo (>= 1.0.0)
-    useragent (0.16.10)
-    webrick (1.8.2)
+    uri (1.0.2)
+    useragent (0.16.11)
     websocket-driver (0.7.6)
     websocket-driver (0.7.6)
       websocket-extensions (>= 0.1.0)
       websocket-extensions (>= 0.1.0)
     websocket-extensions (0.1.5)
     websocket-extensions (0.1.5)
-    zeitwerk (2.7.0)
+    zeitwerk (2.7.1)
 
 
 PLATFORMS
 PLATFORMS
-  arm64-darwin-20
   ruby
   ruby
+  x86_64-darwin-22
   x86_64-linux
   x86_64-linux
 
 
 DEPENDENCIES
 DEPENDENCIES
@@ -269,10 +272,10 @@ DEPENDENCIES
   pg (~> 1.5)
   pg (~> 1.5)
   puma (~> 6.4)
   puma (~> 6.4)
   rackup
   rackup
-  rails (~> 7.2.0)
+  rails (~> 8.0.0)
   redis (~> 5.0)
   redis (~> 5.0)
   trilogy (~> 2.8.1)
   trilogy (~> 2.8.1)
   tzinfo-data
   tzinfo-data
 
 
 BUNDLED WITH
 BUNDLED WITH
-   2.3.3
+   2.5.16

+ 10 - 19
frameworks/Ruby/rails/config/environments/development.rb

@@ -3,9 +3,7 @@ require "active_support/core_ext/integer/time"
 Rails.application.configure do
 Rails.application.configure do
   # Settings specified here will take precedence over those in config/application.rb.
   # Settings specified here will take precedence over those in config/application.rb.
 
 
-  # 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.
+  # Make code changes take effect immediately without server restart.
   config.enable_reloading = true
   config.enable_reloading = true
 
 
   # Do not eager load code on boot.
   # Do not eager load code on boot.
@@ -17,35 +15,31 @@ Rails.application.configure do
   # Enable server timing.
   # Enable server timing.
   config.server_timing = true
   config.server_timing = true
 
 
-  # Enable/disable caching. By default caching is disabled.
-  # Run rails dev:cache to toggle caching.
+  # Enable/disable Action Controller caching. By default Action Controller caching is disabled.
+  # Run rails dev:cache to toggle Action Controller caching.
   if Rails.root.join("tmp/caching-dev.txt").exist?
   if Rails.root.join("tmp/caching-dev.txt").exist?
     config.action_controller.perform_caching = true
     config.action_controller.perform_caching = true
     config.action_controller.enable_fragment_cache_logging = true
     config.action_controller.enable_fragment_cache_logging = true
-
-    config.cache_store = :memory_store
-    config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" }
+    config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
   else
   else
     config.action_controller.perform_caching = false
     config.action_controller.perform_caching = false
-
-    config.cache_store = :null_store
   end
   end
 
 
+  # Change to :null_store to avoid any caching.
+  config.cache_store = :memory_store
+
   # Print deprecation notices to the Rails logger.
   # Print deprecation notices to the Rails logger.
   config.active_support.deprecation = :log
   config.active_support.deprecation = :log
 
 
-  # 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 = []
-
   # Raise an error on page load if there are pending migrations.
   # Raise an error on page load if there are pending migrations.
   config.active_record.migration_error = :page_load
   config.active_record.migration_error = :page_load
 
 
   # Highlight code that triggered database queries in logs.
   # Highlight code that triggered database queries in logs.
   config.active_record.verbose_query_logs = true
   config.active_record.verbose_query_logs = true
 
 
+  # Append comments with runtime information tags to SQL queries in logs.
+  config.active_record.query_log_tags_enabled = true
+
   # Raises error for missing translations.
   # Raises error for missing translations.
   # config.i18n.raise_on_missing_translations = true
   # config.i18n.raise_on_missing_translations = true
 
 
@@ -54,7 +48,4 @@ Rails.application.configure do
 
 
   # Raise error when a before_action's only/except options reference missing actions.
   # Raise error when a before_action's only/except options reference missing actions.
   config.action_controller.raise_on_missing_callback_actions = true
   config.action_controller.raise_on_missing_callback_actions = true
-
-  # Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
-  # config.generators.apply_rubocop_autocorrect_after_generate!
 end
 end

+ 20 - 21
frameworks/Ruby/rails/config/environments/production.rb

@@ -6,19 +6,17 @@ Rails.application.configure do
   # Code is not reloaded between requests.
   # Code is not reloaded between requests.
   config.enable_reloading = false
   config.enable_reloading = false
 
 
-  # Eager load code on boot. This eager loads most of Rails and
-  # your application in memory, allowing both threaded web servers
-  # and those relying on copy on write to perform better.
-  # Rake tasks automatically ignore this option for performance.
+  # Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
   config.eager_load = true
   config.eager_load = true
 
 
-  # Full error reports are disabled and caching is turned on.
+  # Full error reports are disabled.
   config.consider_all_requests_local = false
   config.consider_all_requests_local = false
+
+  # Turn on fragment caching in view templates.
   config.action_controller.perform_caching = true
   config.action_controller.perform_caching = true
 
 
-  # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
-  # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
-  # config.require_master_key = true
+  # Cache assets for far-future expiry since they are all digest stamped.
+  config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
 
 
   # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
   # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
   # This disables the ActionDispatch::Static middleware.
   # This disables the ActionDispatch::Static middleware.
@@ -27,12 +25,7 @@ Rails.application.configure do
   # Enable serving of images, stylesheets, and JavaScripts from an asset server.
   # Enable serving of images, stylesheets, and JavaScripts from an asset server.
   # config.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
-
   # Assume all access to the app is happening through a SSL-terminating reverse proxy.
   # Assume all access to the app is happening through a SSL-terminating reverse proxy.
-  # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
   # config.assume_ssl = true
   # config.assume_ssl = true
 
 
   # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
   # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
@@ -41,14 +34,19 @@ Rails.application.configure do
   # Skip http-to-https redirect for the default health check endpoint.
   # Skip http-to-https redirect for the default health check endpoint.
   # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
   # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
 
 
-  # Prepend all log lines with the following tags.
-  config.log_tags = [ :request_id ]
+  # Log to STDOUT with the current request id as a default log tag.
+  # config.log_tags = [ :request_id ]
+  config.logger   = ActiveSupport::TaggedLogging.logger(STDOUT)
 
 
-  # "info" includes generic and useful information about system operation, but avoids logging too much
-  # information to avoid inadvertent exposure of personally identifiable information (PII). If you
-  # want to log everything, set the level to "debug".
+  # Change to "debug" to log everything (including potentially personally-identifiable information!)
   config.log_level = :fatal
   config.log_level = :fatal
 
 
+  # Prevent health checks from clogging up the logs.
+  config.silence_healthcheck_path = "/up"
+
+  # Don't log any deprecations.
+  config.active_support.report_deprecations = false
+
   # Use a different cache store in production.
   # Use a different cache store in production.
   config.cache_store = :redis_cache_store, {
   config.cache_store = :redis_cache_store, {
     url: ENV['REDIS_URL'],
     url: ENV['REDIS_URL'],
@@ -66,17 +64,18 @@ Rails.application.configure do
   # the I18n.default_locale when a translation cannot be found).
   # the I18n.default_locale when a translation cannot be found).
   config.i18n.fallbacks = true
   config.i18n.fallbacks = true
 
 
-  # Don't log any deprecations.
-  config.active_support.report_deprecations = false
-
   # Do not dump schema after migrations.
   # Do not dump schema after migrations.
   config.active_record.dump_schema_after_migration = false
   config.active_record.dump_schema_after_migration = false
 
 
+  # Only use :id for inspections in production.
+  config.active_record.attributes_for_inspect = [ :id ]
+
   # Enable DNS rebinding protection and other `Host` header attacks.
   # Enable DNS rebinding protection and other `Host` header attacks.
   # config.hosts = [
   # config.hosts = [
   #   "example.com",     # Allow requests from example.com
   #   "example.com",     # Allow requests from example.com
   #   /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
   #   /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
   # ]
   # ]
+  #
   # Skip DNS rebinding protection for the default health check endpoint.
   # Skip DNS rebinding protection for the default health check endpoint.
   # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
   # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
 end
 end

+ 3 - 12
frameworks/Ruby/rails/config/environments/test.rb

@@ -1,5 +1,3 @@
-require "active_support/core_ext/integer/time"
-
 # The test environment is used exclusively to run your application's
 # The test environment is used exclusively to run your application's
 # test suite. You never need to work with it otherwise. Remember that
 # test suite. You never need to work with it otherwise. Remember that
 # your test database is "scratch space" for the test suite and is wiped
 # your test database is "scratch space" for the test suite and is wiped
@@ -17,12 +15,11 @@ Rails.application.configure do
   # loading is working properly before deploying your code.
   # loading is working properly before deploying your code.
   config.eager_load = ENV["CI"].present?
   config.eager_load = ENV["CI"].present?
 
 
-  # Configure public file server for tests with Cache-Control for performance.
-  config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" }
+  # Configure public file server for tests with cache-control for performance.
+  config.public_file_server.headers = { "cache-control" => "public, max-age=3600" }
 
 
-  # Show full error reports and disable caching.
+  # Show full error reports.
   config.consider_all_requests_local = true
   config.consider_all_requests_local = true
-  config.action_controller.perform_caching = false
   config.cache_store = :null_store
   config.cache_store = :null_store
 
 
   # Render exception templates for rescuable exceptions and raise for other exceptions.
   # Render exception templates for rescuable exceptions and raise for other exceptions.
@@ -34,12 +31,6 @@ Rails.application.configure do
   # Print deprecation notices to the stderr.
   # Print deprecation notices to the stderr.
   config.active_support.deprecation = :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.
   # Raises error for missing translations.
   # config.i18n.raise_on_missing_translations = true
   # config.i18n.raise_on_missing_translations = true
 
 

+ 4 - 2
frameworks/Ruby/rails/config/initializers/filter_parameter_logging.rb

@@ -1,6 +1,8 @@
 # Be sure to restart your server when you modify this file.
 # Be sure to restart your server when you modify this file.
 
 
-# Configure sensitive parameters which will be filtered from the log file.
+# Configure parameters to be partially matched (e.g. passw matches password) and 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 += [
 Rails.application.config.filter_parameters += [
-  :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
+  :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
 ]
 ]