diff --git a/app/models/ci/job_artifact.rb b/app/models/ci/job_artifact.rb index 32d7cb3424e..4853b23513c 100644 --- a/app/models/ci/job_artifact.rb +++ b/app/models/ci/job_artifact.rb @@ -87,7 +87,7 @@ module Ci end def hashed_path? - super || self.file_location.nil? + super || self.try(:file_location).nil? end def expire_in diff --git a/changelogs/unreleased/rails5-fix-job-artifact-hashed-path.yml b/changelogs/unreleased/rails5-fix-job-artifact-hashed-path.yml new file mode 100644 index 00000000000..a70bfafb1c9 --- /dev/null +++ b/changelogs/unreleased/rails5-fix-job-artifact-hashed-path.yml @@ -0,0 +1,6 @@ +--- +title: 'Rails 5: fix hashed_path? method that looks up file_location that doesn''t + exist when running certain migration specs' +merge_request: 21510 +author: Jasper Maes +type: other