summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-11-02 12:16:50 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2017-12-03 12:04:48 +0100
commit303f165cbae8367c19ea273fc52170c2a354a8d6 (patch)
tree169d40f5e4f7b31b0f74be2500cfc87601c93c42 /app
parent61864a5a5bb523953589c9398a431c4369fbfc76 (diff)
downloadgitlab-ce-303f165cbae8367c19ea273fc52170c2a354a8d6.tar.gz
Fix creation of job_artifact_uploader
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/build.rb4
-rw-r--r--app/uploaders/job_artifact_uploader.rb6
2 files changed, 2 insertions, 8 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 6d0ebd7f932..8d0c62fcb49 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -15,11 +15,11 @@ module Ci
has_one :last_deployment, -> { order('deployments.id DESC') }, as: :deployable, class_name: 'Deployment'
has_many :trace_sections, class_name: 'Ci::BuildTraceSection'
- has_many :job_artifacts, class_name: 'Ci::JobArtifact', foreign_key: :ci_job_id
+ # TODO: what to do with dependent destroy
+ has_many :job_artifacts, class_name: 'Ci::JobArtifact', foreign_key: :ci_job_id, dependent: :destroy
has_one :job_archive, -> () { where(file_type: Ci::JobArtifact.file_types[:archive]) }, class_name: 'Ci::JobArtifact', foreign_key: :ci_job_id
has_one :job_metadata, -> () { where(file_type: Ci::JobArtifact.file_types[:metadata]) }, class_name: 'Ci::JobArtifact', foreign_key: :ci_job_id
-
# The "environment" field for builds is a String, and is the unexpanded name
def persisted_environment
@persisted_environment ||= Environment.find_by(
diff --git a/app/uploaders/job_artifact_uploader.rb b/app/uploaders/job_artifact_uploader.rb
index 6ea6a85b4a2..cc6e1927f9e 100644
--- a/app/uploaders/job_artifact_uploader.rb
+++ b/app/uploaders/job_artifact_uploader.rb
@@ -3,12 +3,6 @@ class JobArtifactUploader < ArtifactUploader
@artifact = artifact
end
- # If this record exists, the associatied artifact is there. Every artifact
- # persisted will have an associated file
- def exists?
- true
- end
-
def size
return super unless @artifact.size