mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
small upload code refactor
This commit is contained in:
@ -224,7 +224,7 @@ module Email
|
||||
# read attachment
|
||||
File.open(tmp.path, "w+b") { |f| f.write attachment.body.decoded }
|
||||
# create the upload for the user
|
||||
upload = Upload.create_for(user.id, tmp, attachment.filename, File.size(tmp))
|
||||
upload = Upload.create_for(user.id, tmp, attachment.filename, tmp.size)
|
||||
if upload && upload.errors.empty?
|
||||
# TODO: should use the same code as the client to insert attachments
|
||||
raw << "\n#{attachment_markdown(upload)}\n"
|
||||
|
Reference in New Issue
Block a user