comparison app/controllers/attachments_controller.rb @ 958:352539ac7b43 live

Merge from branch "bug_521"
author Chris Cannam
date Tue, 16 Oct 2012 15:36:12 +0100
parents 35782bf2eb58
children 19884e9d5eff
comparison
equal deleted inserted replaced
954:42e2437766c2 958:352539ac7b43
47 format.api 47 format.api
48 end 48 end
49 end 49 end
50 50
51 def download 51 def download
52 if @attachment.container.is_a?(Version) || @attachment.container.is_a?(Project) 52 # cc: formerly this happened only if "@attachment.container.is_a?(Version)"
53 @attachment.increment_download 53 # or Project. Not good for us, we want to tally all downloads
54 end 54 @attachment.increment_download
55 55
56 # images are sent inline 56 # images are sent inline
57 send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename), 57 send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename),
58 :type => detect_content_type(@attachment), 58 :type => detect_content_type(@attachment),
59 :disposition => (@attachment.image? ? 'inline' : 'attachment') 59 :disposition => (@attachment.image? ? 'inline' : 'attachment')