From 2f95b0d67edc0cccdb07a4620c85aca3ebf6b8c6 Mon Sep 17 00:00:00 2001 From: rubic0n Date: Fri, 29 Jan 2021 23:08:33 -0600 Subject: [PATCH] Enable remaining settings - use_cookies_with_metadata Provided extra options for cookies. Existing cookies will work fine. https://github.com/rails/rails/issues/36546 - return_only_media_type_on_content_type Include the charset in the content type. Looking at the headers that are being returned, it already did this. - Use Zeitwerk as the autoloader https://github.com/fxn/zeitwerk --- config/initializers/new_framework_defaults_6_0.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/config/initializers/new_framework_defaults_6_0.rb b/config/initializers/new_framework_defaults_6_0.rb index d45195a0..70406f6c 100644 --- a/config/initializers/new_framework_defaults_6_0.rb +++ b/config/initializers/new_framework_defaults_6_0.rb @@ -14,10 +14,10 @@ Rails.application.config.action_view.default_enforce_utf8 = false # # 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 +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 +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 @@ -49,5 +49,4 @@ Rails.application.config.active_record.collection_cache_versioning = true # classes should be defined. It also requires that constants are not autoloaded in initializers. # Enabling Zeitwerk would be good, but it'll take some work. Using the :classic autoloader gives # us the same autoloading that Rails 5.2 had. -# Rails.application.config.autoloader = :zeitwerk -Rails.application.config.autoloader = :classic +Rails.application.config.autoloader = :zeitwerk