2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

small upload code refactor

This commit is contained in:
Régis Hanol 2015-02-03 18:44:18 +01:00
parent 91b3123e14
commit 0e5c9b2590
10 changed files with 89 additions and 105 deletions

View file

@ -462,7 +462,7 @@ class ImportScripts::Base
src.close
tmp.rewind
Upload.create_for(user_id, tmp, source_filename, File.size(tmp))
Upload.create_for(user_id, tmp, source_filename, tmp.size)
ensure
tmp.close rescue nil
tmp.unlink rescue nil