FIX: Skip validation when saving in `Upload#migrate_to_new_scheme`.

This commit is contained in:
Guo Xiang Tan 2019-03-26 14:28:39 +08:00
parent 6ea14b591f
commit 0ac6a58b09
1 changed files with 1 additions and 1 deletions

View File

@ -259,7 +259,7 @@ class Upload < ActiveRecord::Base
File.open(path) do |f| File.open(path) do |f|
upload.url = Discourse.store.store_upload(f, upload) upload.url = Discourse.store.store_upload(f, upload)
upload.filesize = f.size upload.filesize = f.size
upload.save! upload.save!(validate: false)
end end
# remap the URLs # remap the URLs
DbHelper.remap(UrlHelper.absolute(previous_url), upload.url) unless external DbHelper.remap(UrlHelper.absolute(previous_url), upload.url) unless external