Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2018-09-20 22:32:54 +0300
committerMichael Kozono <mkozono@gmail.com>2018-09-24 22:11:26 +0300
commitf107bc69e34f79ea8faaa154caefe56948b8dd68 (patch)
tree60e65bdf6fd939d3d15113fd1f7a53c12038e5dc /lib/banzai
parent45cf64c827270d66a88d483bb3f9043a90301255 (diff)
Simplify by using Gitlab::SafeRequestStore
These are clear wins.
Diffstat (limited to 'lib/banzai')
-rw-r--r--lib/banzai/filter/external_issue_reference_filter.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/banzai/filter/external_issue_reference_filter.rb b/lib/banzai/filter/external_issue_reference_filter.rb
index b4a7a44e109..8159dcfed72 100644
--- a/lib/banzai/filter/external_issue_reference_filter.rb
+++ b/lib/banzai/filter/external_issue_reference_filter.rb
@@ -97,9 +97,7 @@ module Banzai
private
def external_issues_cached(attribute)
- return project.public_send(attribute) unless RequestStore.active? # rubocop:disable GitlabSecurity/PublicSend
-
- cached_attributes = RequestStore[:banzai_external_issues_tracker_attributes] ||= Hash.new { |h, k| h[k] = {} }
+ cached_attributes = Gitlab::SafeRequestStore[:banzai_external_issues_tracker_attributes] ||= Hash.new { |h, k| h[k] = {} }
cached_attributes[project.id][attribute] = project.public_send(attribute) if cached_attributes[project.id][attribute].nil? # rubocop:disable GitlabSecurity/PublicSend
cached_attributes[project.id][attribute]
end