Commit 9f50c6c3 authored by Mehmet Emin INAC's avatar Mehmet Emin INAC

Remove unnecessary preload from `Security::Finding` model

parent 4f296953
...@@ -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) }
......
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment