  def download
    if @attachment.container.is_a?(Version) || @attachment.container.is_a?(Project)
      @attachment.increment_download
    end

    # images are sent inline
    send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename),
                                    :type => @attachment.content_type,
#                                    :disposition => (@attachment.image? ? 'inline' : 'attachment')
                                       :disposition => ((@attachment.image? || @attachment.is_text?) ? 'inline' : 'attachment')
  end
