summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-02-28 20:00:17 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-02-28 20:00:17 +0000
commit540237033eca92ae26a1f8f44b7ace8fd7f92f16 (patch)
treea024633c045c792da5f799f384d6300aad6b178e /app
parentab0fa04b62af323ea736dce20471726093de0712 (diff)
downloadredmine-540237033eca92ae26a1f8f44b7ace8fd7f92f16.tar.gz
redmine-540237033eca92ae26a1f8f44b7ace8fd7f92f16.zip
Merged r16341 (#25115).
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@16342 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/attachment.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index 4bc674f8d..2b13118b1 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -82,7 +82,6 @@ class Attachment < ActiveRecord::Base
def file=(incoming_file)
unless incoming_file.nil?
@temp_file = incoming_file
- if @temp_file.size > 0
if @temp_file.respond_to?(:original_filename)
self.filename = @temp_file.original_filename
self.filename.force_encoding("UTF-8")
@@ -91,7 +90,6 @@ class Attachment < ActiveRecord::Base
self.content_type = @temp_file.content_type.to_s.chomp
end
self.filesize = @temp_file.size
- end
end
end
@@ -107,7 +105,7 @@ class Attachment < ActiveRecord::Base
# Copies the temporary file to its final location
# and computes its MD5 hash
def files_to_final_location
- if @temp_file && (@temp_file.size > 0)
+ if @temp_file
self.disk_directory = target_directory
self.disk_filename = Attachment.disk_filename(filename, disk_directory)
logger.info("Saving attachment '#{self.diskfile}' (#{@temp_file.size} bytes)") if logger