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:
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 8ecfdeb98f5..a9144fa7c2a 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1706,7 +1706,11 @@ class Project < ApplicationRecord
end
def has_active_integrations?(hooks_scope = :push_hooks)
- integrations.public_send(hooks_scope).any? # rubocop:disable GitlabSecurity/PublicSend
+ @has_active_integrations ||= {} # rubocop: disable Gitlab/PredicateMemoization
+
+ return @has_active_integrations[hooks_scope] if @has_active_integrations.key?(hooks_scope)
+
+ @has_active_integrations[hooks_scope] = integrations.public_send(hooks_scope).any? # rubocop:disable GitlabSecurity/PublicSend
end
def feature_usage