diff options
author | Sean McGivern <sean@gitlab.com> | 2018-02-21 16:09:30 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-02-22 14:32:01 +0000 |
commit | 028562a049f6b5738731be9bedb2b2d9da1b575d (patch) | |
tree | 930f2815d9d004bfcbfa01e4396db8a0e54e2d5e /app/uploaders/personal_file_uploader.rb | |
parent | 0922027877ea08b42b171f5ab2c4e35eabf4f734 (diff) | |
download | gitlab-ce-028562a049f6b5738731be9bedb2b2d9da1b575d.tar.gz |
Fix 500 error when loading an invalid upload URL
Diffstat (limited to 'app/uploaders/personal_file_uploader.rb')
-rw-r--r-- | app/uploaders/personal_file_uploader.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/uploaders/personal_file_uploader.rb b/app/uploaders/personal_file_uploader.rb index e7d9ecd3222..f2ad0badd53 100644 --- a/app/uploaders/personal_file_uploader.rb +++ b/app/uploaders/personal_file_uploader.rb @@ -14,6 +14,12 @@ class PersonalFileUploader < FileUploader File.join(model.class.to_s.underscore, model.id.to_s) end + # model_path_segment does not require a model to be passed, so we can always + # generate a path, even when there's no model. + def model_valid? + true + end + # Revert-Override def store_dir File.join(base_dir, dynamic_segment) |