diff options
Diffstat (limited to 'lib/gitlab/reference_extractor.rb')
-rw-r--r-- | lib/gitlab/reference_extractor.rb | 10 |
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 |