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