parent
baa6af93a2
commit
692ecff3eb
|
@ -267,10 +267,9 @@ class Upload < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
# store to new location & update the filesize
|
# store to new location & update the filesize
|
||||||
File.open(path) do |f|
|
File.open(path) do |f|
|
||||||
upload.update_attributes!(
|
upload.url = Discourse.store.store_upload(f, upload)
|
||||||
url: Discourse.store.store_upload(f, upload),
|
upload.filesize = f.size
|
||||||
filesize: f.size
|
upload.save
|
||||||
)
|
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue