BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
87d66fa5
Commit
87d66fa5
authored
Mar 27, 2017
by
Yorick Peterse
Committed by
DJ Mountney
Mar 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'labels-finder-optimize-project' into 'master'
Optimize labels finder query See merge request !10248
parent
b1944d5e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
labels_finder.rb
app/finders/labels_finder.rb
+11
-2
labels-finder-optimize-project.yml
changelogs/unreleased/labels-finder-optimize-project.yml
+4
-0
No files found.
app/finders/labels_finder.rb
View file @
87d66fa5
...
@@ -20,8 +20,17 @@ class LabelsFinder < UnionFinder
...
@@ -20,8 +20,17 @@ class LabelsFinder < UnionFinder
if
project?
if
project?
if
project
if
project
label_ids
<<
project
.
group
.
labels
if
project
.
group
.
present?
if
project
.
group
.
present?
label_ids
<<
project
.
labels
labels_table
=
Label
.
arel_table
label_ids
<<
Label
.
where
(
labels_table
[
:type
].
eq
(
'GroupLabel'
).
and
(
labels_table
[
:group_id
].
eq
(
project
.
group
.
id
)).
or
(
labels_table
[
:type
].
eq
(
'ProjectLabel'
).
and
(
labels_table
[
:project_id
].
eq
(
project
.
id
))
)
)
else
label_ids
<<
project
.
labels
end
end
end
else
else
label_ids
<<
Label
.
where
(
group_id:
projects
.
group_ids
)
label_ids
<<
Label
.
where
(
group_id:
projects
.
group_ids
)
...
...
changelogs/unreleased/labels-finder-optimize-project.yml
0 → 100644
View file @
87d66fa5
---
title
:
Optimize labels finder query when searching for a project with a group
merge_request
:
author
:
mhasbini
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment