summaryrefslogtreecommitdiff
path: root/app/uploaders
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2017-11-02 19:38:25 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2017-12-03 12:04:49 +0100
commitc7d945758accc6f80ee63c7c3b25782cf7f6f3b0 (patch)
tree4d3f5dd8325eee87ab72a3c0269f452a0edacd82 /app/uploaders
parentcc750539ec852e9f42ea25b31cc14a45962fc975 (diff)
downloadgitlab-ce-c7d945758accc6f80ee63c7c3b25782cf7f6f3b0.tar.gz
Fix most test failures
Diffstat (limited to 'app/uploaders')
-rw-r--r--app/uploaders/job_artifact_uploader.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/app/uploaders/job_artifact_uploader.rb b/app/uploaders/job_artifact_uploader.rb
index cc6e1927f9e..7185e24287f 100644
--- a/app/uploaders/job_artifact_uploader.rb
+++ b/app/uploaders/job_artifact_uploader.rb
@@ -4,7 +4,7 @@ class JobArtifactUploader < ArtifactUploader
end
def size
- return super unless @artifact.size
+ return super if @artifact.size.nil?
@artifact.size
end
@@ -12,17 +12,13 @@ class JobArtifactUploader < ArtifactUploader
private
def disk_hash
- @disk_hash ||= Digest::SHA2.hexdigest(job.project_id.to_s)
+ @disk_hash ||= Digest::SHA2.hexdigest(@artifact.project_id.to_s)
end
def default_path
- creation_date = job.created_at.utc.strftime('%Y_%m_%d')
+ creation_date = @artifact.created_at.utc.strftime('%Y_%m_%d')
File.join(disk_hash[0..1], disk_hash[2..3], disk_hash,
- creation_date, job.id.to_s, @artifact.id.to_s)
- end
-
- def job
- @artifact.job
+ creation_date, @artifact.ci_job_id.to_s, @artifact.id.to_s)
end
end