From 0f2dcffb1df78530a7cc919b659533b5068a0206 Mon Sep 17 00:00:00 2001 From: Jasper Maes Date: Wed, 5 Sep 2018 00:13:45 +0200 Subject: [PATCH] Rails 5: fix hashed_path? method that looks up file_location that doesn't exist when running certain migration specs --- app/models/ci/job_artifact.rb | 2 +- .../unreleased/rails5-fix-job-artifact-hashed-path.yml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/rails5-fix-job-artifact-hashed-path.yml 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