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:
authorJan Provaznik <jprovaznik@gitlab.com>2018-03-30 20:27:03 +0300
committerJan Provaznik <jprovaznik@gitlab.com>2018-04-05 14:29:57 +0300
commitc1946364707947f56048cc00caa6d67fe635f3c7 (patch)
tree107096b44758bf8872bd60d41ed1ab8ab4e86c14 /lib/banzai/cross_project_reference.rb
parent166b4575a6353668c894fea0ba234d0b371dee03 (diff)
Better group support notes-related code
Updates notes-related services and rendering so this code can be easily used for group-scoped resources (specifically Epics). Related to gitlab-ee!5205
Diffstat (limited to 'lib/banzai/cross_project_reference.rb')
-rw-r--r--lib/banzai/cross_project_reference.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/banzai/cross_project_reference.rb b/lib/banzai/cross_project_reference.rb
index d8fb7705b2a..3f1e95d4cc0 100644
--- a/lib/banzai/cross_project_reference.rb
+++ b/lib/banzai/cross_project_reference.rb
@@ -4,7 +4,7 @@ module Banzai
module CrossProjectReference
# Given a cross-project reference string, get the Project record
#
- # Defaults to value of `context[:project]` if:
+ # Defaults to value of `context[:project]`, or `context[:group]` if:
# * No reference is given OR
# * Reference given doesn't exist
#
@@ -12,7 +12,7 @@ module Banzai
#
# Returns a Project, or nil if the reference can't be found
def parent_from_ref(ref)
- return context[:project] unless ref
+ return context[:project] || context[:group] unless ref
Project.find_by_full_path(ref)
end