Merge pull request #48604 from skipkayhil/hm-ensure-cache-format-deprecated
Emit warning when using 6.1 cache format as well
This commit is contained in:
commit
de29ff225e
@ -105,14 +105,6 @@ def self.cache_format_version
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.cache_format_version=(value)
|
def self.cache_format_version=(value)
|
||||||
if value == 6.1
|
|
||||||
ActiveSupport.deprecator.warn <<~EOM
|
|
||||||
Support for `config.active_support.cache_format_version = 6.1` has been deprecated and will be removed in Rails 7.2.
|
|
||||||
|
|
||||||
Check the Rails upgrade guide at https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#new-activesupport-cache-serialization-format
|
|
||||||
for more information on how to upgrade.
|
|
||||||
EOM
|
|
||||||
end
|
|
||||||
Cache.format_version = value
|
Cache.format_version = value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -671,6 +671,12 @@ def clear(options = nil)
|
|||||||
def default_coder
|
def default_coder
|
||||||
case Cache.format_version
|
case Cache.format_version
|
||||||
when 6.1
|
when 6.1
|
||||||
|
ActiveSupport.deprecator.warn <<~EOM
|
||||||
|
Support for `config.active_support.cache_format_version = 6.1` has been deprecated and will be removed in Rails 7.2.
|
||||||
|
|
||||||
|
Check the Rails upgrade guide at https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#new-activesupport-cache-serialization-format
|
||||||
|
for more information on how to upgrade.
|
||||||
|
EOM
|
||||||
Cache::SerializerWithFallback[:marshal_6_1]
|
Cache::SerializerWithFallback[:marshal_6_1]
|
||||||
when 7.0
|
when 7.0
|
||||||
Cache::SerializerWithFallback[:marshal_7_0]
|
Cache::SerializerWithFallback[:marshal_7_0]
|
||||||
|
@ -4246,6 +4246,18 @@ def new(app); self; end
|
|||||||
Rails.cache.instance_variable_get(:@coder)
|
Rails.cache.instance_variable_get(:@coder)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "ActiveSupport::Cache.format_version 6.1 is deprecated" do
|
||||||
|
remove_from_config '.*config\.load_defaults.*\n'
|
||||||
|
|
||||||
|
app "development"
|
||||||
|
|
||||||
|
assert_equal 6.1, ActiveSupport::Cache.format_version
|
||||||
|
|
||||||
|
assert_deprecated(ActiveSupport.deprecator) do
|
||||||
|
ActiveSupport::Cache::Store.new
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
test "raise_on_invalid_cache_expiration_time is false with 7.0 defaults" do
|
test "raise_on_invalid_cache_expiration_time is false with 7.0 defaults" do
|
||||||
remove_from_config '.*config\.load_defaults.*\n'
|
remove_from_config '.*config\.load_defaults.*\n'
|
||||||
add_to_config 'config.load_defaults "7.0"'
|
add_to_config 'config.load_defaults "7.0"'
|
||||||
|
Loading…
Reference in New Issue
Block a user