mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: Don't fail silently.
This commit is contained in:
parent
efd7cbd887
commit
baa6af93a2
1 changed files with 4 additions and 3 deletions
|
@ -267,9 +267,10 @@ class Upload < ActiveRecord::Base
|
|||
end
|
||||
# store to new location & update the filesize
|
||||
File.open(path) do |f|
|
||||
upload.url = Discourse.store.store_upload(f, upload)
|
||||
upload.filesize = f.size
|
||||
upload.save
|
||||
upload.update_attributes!(
|
||||
url: Discourse.store.store_upload(f, upload),
|
||||
filesize: f.size
|
||||
)
|
||||
end
|
||||
# remap the URLs
|
||||
DbHelper.remap(UrlHelper.absolute(previous_url), upload.url) unless external
|
||||
|
|
Loading…
Reference in a new issue