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
337403df
Commit
337403df
authored
Mar 19, 2018
by
Robert Speicher
Committed by
Robert Speicher
Mar 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'sh-admin-projects-remove-n-plus-one' into 'master'
Remove N+1 queries in /admin/projects page See merge request gitlab-org/gitlab-ce!17834
parent
fb3ecaf1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
projects_finder.rb
app/finders/admin/projects_finder.rb
+1
-0
projects_controller_spec.rb
spec/controllers/admin/projects_controller_spec.rb
+10
-0
No files found.
app/finders/admin/projects_finder.rb
View file @
337403df
...
@@ -16,6 +16,7 @@ class Admin::ProjectsFinder
...
@@ -16,6 +16,7 @@ class Admin::ProjectsFinder
items
=
by_archived
(
items
)
items
=
by_archived
(
items
)
items
=
by_personal
(
items
)
items
=
by_personal
(
items
)
items
=
by_name
(
items
)
items
=
by_name
(
items
)
items
=
items
.
includes
(
namespace:
[
:owner
])
sort
(
items
).
page
(
params
[
:page
])
sort
(
items
).
page
(
params
[
:page
])
end
end
...
...
spec/controllers/admin/projects_controller_spec.rb
View file @
337403df
...
@@ -31,5 +31,15 @@ describe Admin::ProjectsController do
...
@@ -31,5 +31,15 @@ describe Admin::ProjectsController do
expect
(
response
.
body
).
not_to
match
(
pending_delete_project
.
name
)
expect
(
response
.
body
).
not_to
match
(
pending_delete_project
.
name
)
expect
(
response
.
body
).
to
match
(
project
.
name
)
expect
(
response
.
body
).
to
match
(
project
.
name
)
end
end
it
'does not have N+1 queries'
,
:use_clean_rails_memory_store_caching
,
:request_store
do
get
:index
control_count
=
ActiveRecord
::
QueryRecorder
.
new
{
get
:index
}.
count
create
(
:project
)
expect
{
get
:index
}.
not_to
exceed_query_limit
(
control_count
)
end
end
end
end
end
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