Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9f50c6c3
Commit
9f50c6c3
authored
Dec 15, 2020
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary preload from `Security::Finding` model
parent
4f296953
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
ee/app/models/security/finding.rb
ee/app/models/security/finding.rb
+1
-1
ee/spec/finders/security/findings_finder_spec.rb
ee/spec/finders/security/findings_finder_spec.rb
+1
-1
No files found.
ee/app/models/security/finding.rb
View file @
9f50c6c3
...
@@ -38,7 +38,7 @@ module Security
...
@@ -38,7 +38,7 @@ module Security
.
where
(
'vulnerability_feedback.project_fingerprint = security_findings.project_fingerprint'
))
.
where
(
'vulnerability_feedback.project_fingerprint = security_findings.project_fingerprint'
))
end
end
scope
:ordered
,
->
{
order
(
severity: :desc
,
confidence: :desc
,
id: :asc
)
}
scope
:ordered
,
->
{
order
(
severity: :desc
,
confidence: :desc
,
id: :asc
)
}
scope
:with_pipeline_entities
,
->
{
includes
(
build:
[
:job_artifacts
,
pipeline: :project
])
}
scope
:with_pipeline_entities
,
->
{
includes
(
build:
[
:job_artifacts
,
:pipeline
])
}
scope
:with_scan
,
->
{
includes
(
:scan
)
}
scope
:with_scan
,
->
{
includes
(
:scan
)
}
scope
:with_scanner
,
->
{
includes
(
:scanner
)
}
scope
:with_scanner
,
->
{
includes
(
:scanner
)
}
scope
:deduplicated
,
->
{
where
(
deduplicated:
true
)
}
scope
:deduplicated
,
->
{
where
(
deduplicated:
true
)
}
...
...
ee/spec/finders/security/findings_finder_spec.rb
View file @
9f50c6c3
...
@@ -91,7 +91,7 @@ RSpec.describe Security::FindingsFinder do
...
@@ -91,7 +91,7 @@ RSpec.describe Security::FindingsFinder do
end
end
it
'does not cause N+1 queries'
do
it
'does not cause N+1 queries'
do
expect
{
finder_result
}.
not_to
exceed_query_limit
(
9
)
expect
{
finder_result
}.
not_to
exceed_query_limit
(
8
)
end
end
describe
'#current_page'
do
describe
'#current_page'
do
...
...
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