From 0ac6a58b09cfd44e61b2106fb1a9fd99b2ce2cae Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 26 Mar 2019 14:28:39 +0800 Subject: [PATCH] FIX: Skip validation when saving in `Upload#migrate_to_new_scheme`. --- app/models/upload.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/upload.rb b/app/models/upload.rb index 4a53823df5a..8e1b312b9aa 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -259,7 +259,7 @@ class Upload < ActiveRecord::Base File.open(path) do |f| upload.url = Discourse.store.store_upload(f, upload) upload.filesize = f.size - upload.save! + upload.save!(validate: false) end # remap the URLs DbHelper.remap(UrlHelper.absolute(previous_url), upload.url) unless external