Mercurial > hg > soundsoftware-site
diff app/controllers/attachments_controller.rb @ 1026:b42553f6df71 bibplugin_bibtex
Merge
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Tue, 13 Nov 2012 13:23:29 +0000 |
parents | 19884e9d5eff |
children | bb32da3bea34 |
line wrap: on
line diff
--- a/app/controllers/attachments_controller.rb Mon Aug 06 12:33:23 2012 +0100 +++ b/app/controllers/attachments_controller.rb Tue Nov 13 13:23:29 2012 +0000 @@ -17,6 +17,9 @@ class AttachmentsController < ApplicationController + include AttachmentsHelper + helper :attachments + before_filter :find_project before_filter :file_readable, :read_authorize, :except => :destroy before_filter :delete_authorize, :only => :destroy @@ -49,7 +52,9 @@ end def download - if @attachment.container.is_a?(Version) || @attachment.container.is_a?(Project) + # cc: formerly this happened only if "@attachment.container.is_a?(Version)" + # or Project. Not good for us, we want to tally all downloads [by humans] + if not user_is_search_bot? @attachment.increment_download end