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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-29 00:10:13 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-29 00:10:13 +0300
commit8f016fe5fb42704dd949e77859888fcd898fd985 (patch)
tree32c3c311c5fb330769601b2cf684aebe6f102196 /lib/gitlab/reference_extractor.rb
parente4632f4c63eae7ec36243d11b23d69b4fd880830 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/reference_extractor.rb')
-rw-r--r--lib/gitlab/reference_extractor.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/gitlab/reference_extractor.rb b/lib/gitlab/reference_extractor.rb
index d7501fc7068..547549361be 100644
--- a/lib/gitlab/reference_extractor.rb
+++ b/lib/gitlab/reference_extractor.rb
@@ -24,8 +24,8 @@ module Gitlab
super(text, context.merge(project: project))
end
- def references(type)
- refs = super(type, project, current_user)
+ def references(type, ids_only: false)
+ refs = super(type, project, current_user, ids_only: ids_only)
@stateful_not_visible_counter += refs[:not_visible].count
refs[:visible]
@@ -41,6 +41,12 @@ module Gitlab
define_method(type.to_s.pluralize) do
@references[type] ||= references(type)
end
+
+ if %w(mentioned_user mentioned_group mentioned_project).include?(type.to_s)
+ define_method("#{type}_ids") do
+ @references[type] ||= references(type, ids_only: true)
+ end
+ end
end
def issues