From 692ecff3eb5b870dec7c51cce15c96fce409f353 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 2 Sep 2016 11:58:56 +0800 Subject: [PATCH] Revert "FIX: Don't fail silently." This reverts commit baa6af93a281f3b00c47122fc8a2719fcbe84271. --- app/models/upload.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/upload.rb b/app/models/upload.rb index e168b869702..9fa7341ce57 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -267,10 +267,9 @@ class Upload < ActiveRecord::Base end # store to new location & update the filesize File.open(path) do |f| - upload.update_attributes!( - url: Discourse.store.store_upload(f, upload), - filesize: f.size - ) + upload.url = Discourse.store.store_upload(f, upload) + upload.filesize = f.size + upload.save end # remap the URLs DbHelper.remap(UrlHelper.absolute(previous_url), upload.url) unless external