From e6d556c80974e6e3f6190b216ce4c9d20b25ef7d Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Wed, 21 Jan 2026 15:16:48 +1100 Subject: [PATCH] Update locale cache key to invalidate cache --- app/helpers/application_helper.rb | 2 +- spec/helpers/application_helper_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4da992b8ef..ae1fb6849c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -74,6 +74,6 @@ module ApplicationHelper # Update "v1" to invalidate existing cache key def cache_key_with_locale(key, locale) - Array.wrap(key) + ["v2", locale.to_s, I18nDigests.for_locale(locale)] + Array.wrap(key) + ["v3", locale.to_s, I18nDigests.for_locale(locale)] end end diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 59dd6c4013..9d68a60816 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -87,13 +87,13 @@ RSpec.describe ApplicationHelper do it "appends locale and digest to a single key" do expect( helper.cache_key_with_locale("single-key", "en") - ).to eq(["single-key", "v2", "en", en_digest]) + ).to eq(["single-key", "v3", "en", en_digest]) end it "appends locale and digest to multiple keys" do expect( helper.cache_key_with_locale(["array", "of", "keys"], "es") - ).to eq(["array", "of", "keys", "v2", "es", es_digest]) + ).to eq(["array", "of", "keys", "v3", "es", es_digest]) end end end