From 1a4a0d7e89a25e7cdcf84102a675286900464138 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 2 Sep 2016 11:59:03 +0800 Subject: [PATCH] FIX: Don't fail silently. --- 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 9fa7341ce..7ef99d3a2 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -269,7 +269,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! end # remap the URLs DbHelper.remap(UrlHelper.absolute(previous_url), upload.url) unless external