From 14f66b1e9e4bfc0bc031e008a68229d385887699 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 22 Jul 2023 12:52:53 -0700 Subject: [PATCH] Fix caching crashes in `localized_cache` The controller was like "oh yeah we have that cached" (from previous renders of the app on Rails 3 I think?), but the view disagreed, bc it was appending a template digest to the cache key. That's a smart feature, but not compatible with how we skip queries in the controller, so disable it for now! --- app/helpers/application_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f4c28488..522ac307 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -127,7 +127,9 @@ module ApplicationHelper def localized_cache(key={}, &block) localized_key = localize_fragment_key(key, locale) - cache(localized_key, &block) + # TODO: The digest feature is handy, but it's not compatible with how we + # check for fragments existence in the controller, so skip it for now. + cache(localized_key, skip_digest: true, &block) end def login_path_with_return_to