summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorMario de la Ossa <mariodelaossa@gmail.com>2018-10-02 20:56:51 -0600
committerMario de la Ossa <mariodelaossa@gmail.com>2018-10-04 10:12:18 -0600
commit7cb2755617a2f29498f4523b8915bc77abcae4df (patch)
tree8706a18ab3772c1976a43a16f956df094562ed96 /app/finders
parent42822a7d45f063804fe04f44e15cf04549460ae7 (diff)
downloadgitlab-ce-7cb2755617a2f29498f4523b8915bc77abcae4df.tar.gz
Banzai project ref- share context more aggresively
Changes `Banzai::CrossProjectReference#parent_from_ref` to return the project in the context if the project's `full_path` matches the ref we're looking for, as it makes no sense to go to the database to find a Project we already have loaded.
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/labels_finder.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/finders/labels_finder.rb b/app/finders/labels_finder.rb
index 08fc2968e77..0293101f3c1 100644
--- a/app/finders/labels_finder.rb
+++ b/app/finders/labels_finder.rb
@@ -116,7 +116,7 @@ class LabelsFinder < UnionFinder
end
def project?
- params[:project_id].present?
+ params[:project].present? || params[:project_id].present?
end
def projects?
@@ -139,7 +139,7 @@ class LabelsFinder < UnionFinder
return @project if defined?(@project)
if project?
- @project = Project.find(params[:project_id])
+ @project = params[:project] || Project.find(params[:project_id])
@project = nil unless authorized_to_read_labels?(@project)
else
@project = nil