summaryrefslogtreecommitdiff
path: root/app/models/ci/job_artifact.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/ci/job_artifact.rb')
-rw-r--r--app/models/ci/job_artifact.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/ci/job_artifact.rb b/app/models/ci/job_artifact.rb
index da2758507ce..add9110ee5e 100644
--- a/app/models/ci/job_artifact.rb
+++ b/app/models/ci/job_artifact.rb
@@ -5,6 +5,7 @@ module Ci
include AfterCommitQueue
include ObjectStorage::BackgroundMove
include UpdateProjectStatistics
+ include Sortable
extend Gitlab::Ci::Model
NotSupportedAdapterError = Class.new(StandardError)
@@ -143,6 +144,10 @@ module Ci
self.update_column(:file_store, file.object_store)
end
+ def self.total_size
+ self.sum(:size)
+ end
+
def self.artifacts_size_for(project)
self.where(project: project).sum(:size)
end