summaryrefslogtreecommitdiff
path: root/app/controllers/concerns/issuable_actions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/concerns/issuable_actions.rb')
-rw-r--r--app/controllers/concerns/issuable_actions.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/concerns/issuable_actions.rb b/app/controllers/concerns/issuable_actions.rb
index 7ee680db7f9..e1e662a1968 100644
--- a/app/controllers/concerns/issuable_actions.rb
+++ b/app/controllers/concerns/issuable_actions.rb
@@ -158,8 +158,10 @@ module IssuableActions
discussions = Discussion.build_collection(notes, issuable)
- if issuable.is_a?(MergeRequest) && Feature.enabled?(:merge_request_discussion_cache, issuable.target_project, default_enabled: :yaml)
- render_cached(discussions, with: discussion_serializer, context: self)
+ if issuable.is_a?(MergeRequest)
+ cache_context = [current_user&.cache_key, project.team.human_max_access(current_user&.id)].join(':')
+
+ render_cached(discussions, with: discussion_serializer, cache_context: -> (_) { cache_context }, context: self)
else
render json: discussion_serializer.represent(discussions, context: self)
end