summaryrefslogtreecommitdiff
path: root/app/models/ci/job_artifact.rb
diff options
context:
space:
mode:
authorVictor Zagorodny <vzagorodny@gitlab.com>2019-08-28 14:26:42 +0000
committerKamil TrzciƄski <ayufan@ayufan.eu>2019-08-28 14:26:42 +0000
commite4fbd94cf5eba0b103bd97627d822f2014dfe474 (patch)
tree4d3718b36b12a3f7ac08a8b7c9e3f6a337c66f15 /app/models/ci/job_artifact.rb
parent8c262bf7d0992dcdc533d8d7c866adb9dc43467a (diff)
downloadgitlab-ce-e4fbd94cf5eba0b103bd97627d822f2014dfe474.tar.gz
Update CE files for GSD projects filter
A new param with_security_reports was added to GET /groups/:id/projects API and the code to support this logic in GroupProjectsFinder and Project model. Also, a DB index was added to ci_job_artifacts table to speed up the search of security reports artifacts for projects
Diffstat (limited to 'app/models/ci/job_artifact.rb')
-rw-r--r--app/models/ci/job_artifact.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/ci/job_artifact.rb b/app/models/ci/job_artifact.rb
index e132cb045e2..b4497d8af09 100644
--- a/app/models/ci/job_artifact.rb
+++ b/app/models/ci/job_artifact.rb
@@ -87,6 +87,8 @@ module Ci
scope :expired, -> (limit) { where('expire_at < ?', Time.now).limit(limit) }
+ scope :scoped_project, -> { where('ci_job_artifacts.project_id = projects.id') }
+
delegate :filename, :exists?, :open, to: :file
enum file_type: {