From 2234fee59d5b79110682524d51e54d9cea8ed863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Mon, 30 Jun 2025 13:41:41 +0200 Subject: [PATCH] Don't cache only on user The user itself doesn't update when a new attribute help text or role is added to them --- app/models/attribute_help_text.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/attribute_help_text.rb b/app/models/attribute_help_text.rb index fb0f2f30aa2..f9797bfa4d3 100644 --- a/app/models/attribute_help_text.rb +++ b/app/models/attribute_help_text.rb @@ -30,7 +30,9 @@ class AttributeHelpText < ApplicationRecord acts_as_attachable viewable_by_all_users: true def self.cached(user) - OpenProject::Cache.fetch([name, user]) { visible(user).select(:id, :attribute_name).index_by(&:attribute_name) } + RequestStore.fetch(name) do + visible(user).select(:id, :attribute_name).index_by(&:attribute_name) + end end def self.for(model)