Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use rails 7 cache format as 7 can read either 6 or 7 #23210

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ class Application < Rails::Application
#
# https://bugs.ruby-lang.org/issues/14372
#

# TODO: Remove this once we move to config.load_defaults 7.0 as this is the default.
# Note, rails 7 can read cache format from 6 or 7 so there is no risk if you're running rails 7.
# See: https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#new-activesupport-cache-serialization-format
warn "Warning: Remove redundant config.active_support.cache_format_version = 7.0 from #{__FILE__}:#{__LINE__ + 1} if using config.load_defaults 7.0" if config.active_support.cache_format_version == 7.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note, this is nil if you load defaults earlier than 7.0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we get these warnings for a while while we support both 6 and 7?
Or are we dropping 6 super quick as we migrate to 7.2 land?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This warning will only occur when we're on rails 7.0+ where we're using config.load_defaults 7.0 or newer. It's a reminder to remove this setting when #23176 is merged.

config.active_support.cache_format_version = 7.0

config.autoload_paths << Rails.root.join("app/models/aliases").to_s
config.autoload_paths << Rails.root.join("app/models/mixins").to_s
config.autoload_paths << Rails.root.join("lib").to_s
Expand Down