From cdd70b4f79361e89f75f166bd9c7028d5c343f96 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 1 Feb 2024 10:20:45 +0000 Subject: [PATCH 1/8] Add missing new framework defaults file Added so we can review these options. --- config/initializers/new_framework_defaults_5_1.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 config/initializers/new_framework_defaults_5_1.rb diff --git a/config/initializers/new_framework_defaults_5_1.rb b/config/initializers/new_framework_defaults_5_1.rb new file mode 100644 index 0000000000..9010abd5c2 --- /dev/null +++ b/config/initializers/new_framework_defaults_5_1.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. +# +# This file contains migration options to ease your Rails 5.1 upgrade. +# +# Once upgraded flip defaults one by one to migrate to the new default. +# +# Read the Guide for Upgrading Ruby on Rails for more info on each option. + +# Make `form_with` generate non-remote forms. +Rails.application.config.action_view.form_with_generates_remote_forms = false + +# Unknown asset fallback will return the path passed in when the given +# asset is not present in the asset pipeline. +# Rails.application.config.assets.unknown_asset_fallback = false From e97925b440ee64a581634dffa5e5fbf4757e0284 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 1 Feb 2024 10:21:47 +0000 Subject: [PATCH 2/8] Update to configuration defaults for Rails 5.0 --- config/application.rb | 1 + config/initializers/new_framework_defaults.rb | 20 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) delete mode 100644 config/initializers/new_framework_defaults.rb diff --git a/config/application.rb b/config/application.rb index b1dee98822..d41ffbe86d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -31,6 +31,7 @@ class Application < Rails::Application # # config.time_zone = "Central Time (US & Canada)" # config.eager_load_paths << Rails.root.join("extras") + config.load_defaults = 5.0 config.autoloader = :zeitwerk config.active_record.legacy_connection_handling = false config.active_support.use_rfc4122_namespaced_uuids = true diff --git a/config/initializers/new_framework_defaults.rb b/config/initializers/new_framework_defaults.rb deleted file mode 100644 index a2bfed3009..0000000000 --- a/config/initializers/new_framework_defaults.rb +++ /dev/null @@ -1,20 +0,0 @@ -# Be sure to restart your server when you modify this file. -# -# This file contains migration options to ease your Rails 5.0 upgrade. -# -# Once upgraded flip defaults one by one to migrate to the new default. -# -# Read the Guide for Upgrading Ruby on Rails for more info on each option. - -# Enable per-form CSRF tokens. Previous versions had false. -Rails.application.config.action_controller.per_form_csrf_tokens = false - -# Enable origin-checking CSRF mitigation. Previous versions had false. -Rails.application.config.action_controller.forgery_protection_origin_check = false - -# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`. -# Previous versions had false. -ActiveSupport.to_time_preserves_timezone = false - -# Require `belongs_to` associations by default. Previous versions had false. -Rails.application.config.active_record.belongs_to_required_by_default = false From 5ee4a12a4f9a76584c52f9a29f69f0267e176d99 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 1 Feb 2024 10:23:03 +0000 Subject: [PATCH 3/8] Update to configuration defaults for Rails 5.1 --- config/application.rb | 2 +- config/initializers/new_framework_defaults_5_1.rb | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 config/initializers/new_framework_defaults_5_1.rb diff --git a/config/application.rb b/config/application.rb index d41ffbe86d..1a18afcd4a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -31,7 +31,7 @@ class Application < Rails::Application # # config.time_zone = "Central Time (US & Canada)" # config.eager_load_paths << Rails.root.join("extras") - config.load_defaults = 5.0 + config.load_defaults = 5.1 config.autoloader = :zeitwerk config.active_record.legacy_connection_handling = false config.active_support.use_rfc4122_namespaced_uuids = true diff --git a/config/initializers/new_framework_defaults_5_1.rb b/config/initializers/new_framework_defaults_5_1.rb deleted file mode 100644 index 9010abd5c2..0000000000 --- a/config/initializers/new_framework_defaults_5_1.rb +++ /dev/null @@ -1,14 +0,0 @@ -# Be sure to restart your server when you modify this file. -# -# This file contains migration options to ease your Rails 5.1 upgrade. -# -# Once upgraded flip defaults one by one to migrate to the new default. -# -# Read the Guide for Upgrading Ruby on Rails for more info on each option. - -# Make `form_with` generate non-remote forms. -Rails.application.config.action_view.form_with_generates_remote_forms = false - -# Unknown asset fallback will return the path passed in when the given -# asset is not present in the asset pipeline. -# Rails.application.config.assets.unknown_asset_fallback = false From 2de0b210d3f201df4dc8177612cc3d4f4be4c95a Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 1 Feb 2024 10:23:31 +0000 Subject: [PATCH 4/8] Update to configuration defaults for Rails 5.2 --- config/application.rb | 2 +- .../new_framework_defaults_5_2.rb | 38 ------------------- 2 files changed, 1 insertion(+), 39 deletions(-) delete mode 100644 config/initializers/new_framework_defaults_5_2.rb diff --git a/config/application.rb b/config/application.rb index 1a18afcd4a..7aa6ec8dd7 100644 --- a/config/application.rb +++ b/config/application.rb @@ -31,7 +31,7 @@ class Application < Rails::Application # # config.time_zone = "Central Time (US & Canada)" # config.eager_load_paths << Rails.root.join("extras") - config.load_defaults = 5.1 + config.load_defaults = 5.2 config.autoloader = :zeitwerk config.active_record.legacy_connection_handling = false config.active_support.use_rfc4122_namespaced_uuids = true diff --git a/config/initializers/new_framework_defaults_5_2.rb b/config/initializers/new_framework_defaults_5_2.rb deleted file mode 100644 index c383d072bc..0000000000 --- a/config/initializers/new_framework_defaults_5_2.rb +++ /dev/null @@ -1,38 +0,0 @@ -# Be sure to restart your server when you modify this file. -# -# This file contains migration options to ease your Rails 5.2 upgrade. -# -# Once upgraded flip defaults one by one to migrate to the new default. -# -# Read the Guide for Upgrading Ruby on Rails for more info on each option. - -# Make Active Record use stable #cache_key alongside new #cache_version method. -# This is needed for recyclable cache keys. -# Rails.application.config.active_record.cache_versioning = true - -# Use AES-256-GCM authenticated encryption for encrypted cookies. -# Also, embed cookie expiry in signed or encrypted cookies for increased security. -# -# This option is not backwards compatible with earlier Rails versions. -# It's best enabled when your entire app is migrated and stable on 5.2. -# -# Existing cookies will be converted on read then written with the new scheme. -# Rails.application.config.action_dispatch.use_authenticated_cookie_encryption = true - -# Use AES-256-GCM authenticated encryption as default cipher for encrypting messages -# instead of AES-256-CBC, when use_authenticated_message_encryption is set to true. -# Rails.application.config.active_support.use_authenticated_message_encryption = true - -# Add default protection from forgery to ActionController::Base instead of in -# ApplicationController. -# Rails.application.config.action_controller.default_protect_from_forgery = true - -# Store boolean values are in sqlite3 databases as 1 and 0 instead of 't' and -# 'f' after migrating old data. -# Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true - -# Use SHA-1 instead of MD5 to generate non-sensitive digests, such as the ETag header. -# Rails.application.config.active_support.use_sha1_digests = true - -# Make `form_with` generate id attributes for any generated HTML tags. -# Rails.application.config.action_view.form_with_generates_ids = true From d69ecc8b1faf4f1dda3a5dc2d9167949d4326fbd Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 1 Feb 2024 10:24:07 +0000 Subject: [PATCH 5/8] Update to configuration defaults for Rails 6.0 --- config/application.rb | 2 +- .../new_framework_defaults_6_0.rb | 45 ------------------- 2 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 config/initializers/new_framework_defaults_6_0.rb diff --git a/config/application.rb b/config/application.rb index 7aa6ec8dd7..21b092ecc5 100644 --- a/config/application.rb +++ b/config/application.rb @@ -31,7 +31,7 @@ class Application < Rails::Application # # config.time_zone = "Central Time (US & Canada)" # config.eager_load_paths << Rails.root.join("extras") - config.load_defaults = 5.2 + config.load_defaults = 6.0 config.autoloader = :zeitwerk config.active_record.legacy_connection_handling = false config.active_support.use_rfc4122_namespaced_uuids = true diff --git a/config/initializers/new_framework_defaults_6_0.rb b/config/initializers/new_framework_defaults_6_0.rb deleted file mode 100644 index 92240ef5f5..0000000000 --- a/config/initializers/new_framework_defaults_6_0.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Be sure to restart your server when you modify this file. -# -# This file contains migration options to ease your Rails 6.0 upgrade. -# -# Once upgraded flip defaults one by one to migrate to the new default. -# -# Read the Guide for Upgrading Ruby on Rails for more info on each option. - -# Don't force requests from old versions of IE to be UTF-8 encoded. -# Rails.application.config.action_view.default_enforce_utf8 = false - -# Embed purpose and expiry metadata inside signed and encrypted -# cookies for increased security. -# -# This option is not backwards compatible with earlier Rails versions. -# It's best enabled when your entire app is migrated and stable on 6.0. -# Rails.application.config.action_dispatch.use_cookies_with_metadata = true - -# Change the return value of `ActionDispatch::Response#content_type` to Content-Type header without modification. -# Rails.application.config.action_dispatch.return_only_media_type_on_content_type = false - -# Return false instead of self when enqueuing is aborted from a callback. -# Rails.application.config.active_job.return_false_on_aborted_enqueue = true - -# Send Active Storage analysis and purge jobs to dedicated queues. -# Rails.application.config.active_storage.queues.analysis = :active_storage_analysis -# Rails.application.config.active_storage.queues.purge = :active_storage_purge - -# When assigning to a collection of attachments declared via `has_many_attached`, replace existing -# attachments instead of appending. Use #attach to add new attachments without replacing existing ones. -# Rails.application.config.active_storage.replace_on_assign_to_many = true - -# Use ActionMailer::MailDeliveryJob for sending parameterized and normal mail. -# -# The default delivery jobs (ActionMailer::Parameterized::DeliveryJob, ActionMailer::DeliveryJob), -# will be removed in Rails 6.1. This setting is not backwards compatible with earlier Rails versions. -# If you send mail in the background, job workers need to have a copy of -# MailDeliveryJob to ensure all delivery jobs are processed properly. -# Make sure your entire app is migrated and stable on 6.0 before using this setting. -# Rails.application.config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob" - -# Enable the same cache key to be reused when the object being cached of type -# `ActiveRecord::Relation` changes by moving the volatile information (max updated at and count) -# of the relation's cache key into the cache version to support recycling cache key. -# Rails.application.config.active_record.collection_cache_versioning = true From 38be79d0801050f0408e9bb6b583a9455a6d346d Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 1 Feb 2024 10:24:37 +0000 Subject: [PATCH 6/8] Update to configuration defaults for Rails 6.1 --- config/application.rb | 2 +- .../new_framework_defaults_6_1.rb | 67 ------------------- 2 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 config/initializers/new_framework_defaults_6_1.rb diff --git a/config/application.rb b/config/application.rb index 21b092ecc5..b2189ce1a1 100644 --- a/config/application.rb +++ b/config/application.rb @@ -31,7 +31,7 @@ class Application < Rails::Application # # config.time_zone = "Central Time (US & Canada)" # config.eager_load_paths << Rails.root.join("extras") - config.load_defaults = 6.0 + config.load_defaults = 6.1 config.autoloader = :zeitwerk config.active_record.legacy_connection_handling = false config.active_support.use_rfc4122_namespaced_uuids = true diff --git a/config/initializers/new_framework_defaults_6_1.rb b/config/initializers/new_framework_defaults_6_1.rb deleted file mode 100644 index 9526b835ab..0000000000 --- a/config/initializers/new_framework_defaults_6_1.rb +++ /dev/null @@ -1,67 +0,0 @@ -# Be sure to restart your server when you modify this file. -# -# This file contains migration options to ease your Rails 6.1 upgrade. -# -# Once upgraded flip defaults one by one to migrate to the new default. -# -# Read the Guide for Upgrading Ruby on Rails for more info on each option. - -# Support for inversing belongs_to -> has_many Active Record associations. -# Rails.application.config.active_record.has_many_inversing = true - -# Track Active Storage variants in the database. -# Rails.application.config.active_storage.track_variants = true - -# Apply random variation to the delay when retrying failed jobs. -# Rails.application.config.active_job.retry_jitter = 0.15 - -# Stop executing `after_enqueue`/`after_perform` callbacks if -# `before_enqueue`/`before_perform` respectively halts with `throw :abort`. -# Rails.application.config.active_job.skip_after_callbacks_if_terminated = true - -# Specify cookies SameSite protection level: either :none, :lax, or :strict. -# -# This change is not backwards compatible with earlier Rails versions. -# It's best enabled when your entire app is migrated and stable on 6.1. -# Rails.application.config.action_dispatch.cookies_same_site_protection = :lax - -# Generate CSRF tokens that are encoded in URL-safe Base64. -# -# This change is not backwards compatible with earlier Rails versions. -# It's best enabled when your entire app is migrated and stable on 6.1. -# Rails.application.config.action_controller.urlsafe_csrf_tokens = true - -# Specify whether `ActiveSupport::TimeZone.utc_to_local` returns a time with an -# UTC offset or a UTC time. -# ActiveSupport.utc_to_local_returns_utc_offset_times = true - -# Change the default HTTP status code to `308` when redirecting non-GET/HEAD -# requests to HTTPS in `ActionDispatch::SSL` middleware. -# Rails.application.config.action_dispatch.ssl_default_redirect_status = 308 - -# Use new connection handling API. For most applications this won't have any -# effect. For applications using multiple databases, this new API provides -# support for granular connection swapping. -# Rails.application.config.active_record.legacy_connection_handling = false - -# Make `form_with` generate non-remote forms by default. -# Rails.application.config.action_view.form_with_generates_remote_forms = false - -# Set the default queue name for the analysis job to the queue adapter default. -# Rails.application.config.active_storage.queues.analysis = nil - -# Set the default queue name for the purge job to the queue adapter default. -# Rails.application.config.active_storage.queues.purge = nil - -# Set the default queue name for the incineration job to the queue adapter default. -# Rails.application.config.action_mailbox.queues.incineration = nil - -# Set the default queue name for the routing job to the queue adapter default. -# Rails.application.config.action_mailbox.queues.routing = nil - -# Set the default queue name for the mail deliver job to the queue adapter default. -# Rails.application.config.action_mailer.deliver_later_queue_name = nil - -# Generate a `Link` header that gives a hint to modern browsers about -# preloading assets when using `javascript_include_tag` and `stylesheet_link_tag`. -# Rails.application.config.action_view.preload_links_header = true From 3d402eb05bb681478a6d09c788b26d258c3625c1 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 1 Feb 2024 10:25:13 +0000 Subject: [PATCH 7/8] Update to configuration defaults for Rails 7.0 --- config/application.rb | 2 +- .../new_framework_defaults_7_0.rb | 141 ------------------ 2 files changed, 1 insertion(+), 142 deletions(-) delete mode 100644 config/initializers/new_framework_defaults_7_0.rb diff --git a/config/application.rb b/config/application.rb index b2189ce1a1..c58dc2a0ae 100644 --- a/config/application.rb +++ b/config/application.rb @@ -31,7 +31,7 @@ class Application < Rails::Application # # config.time_zone = "Central Time (US & Canada)" # config.eager_load_paths << Rails.root.join("extras") - config.load_defaults = 6.1 + config.load_defaults = 7.0 config.autoloader = :zeitwerk config.active_record.legacy_connection_handling = false config.active_support.use_rfc4122_namespaced_uuids = true diff --git a/config/initializers/new_framework_defaults_7_0.rb b/config/initializers/new_framework_defaults_7_0.rb deleted file mode 100644 index 1cd17e47f7..0000000000 --- a/config/initializers/new_framework_defaults_7_0.rb +++ /dev/null @@ -1,141 +0,0 @@ -# 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 `