Backported r11196 from trunk (#7510).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.2-stable@11229 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2013-01-20 16:55:37 +00:00
parent 3a8b872a09
commit f1314278d5
3 changed files with 22 additions and 1 deletions
+1 -1
View File
@@ -819,7 +819,7 @@ module ApplicationHelper
end
when 'attachment'
attachments = options[:attachments] || (obj && obj.respond_to?(:attachments) ? obj.attachments : nil)
if attachments && attachment = attachments.detect {|a| a.filename == name }
if attachments && attachment = Attachment.latest_attach(attachments, name)
link = link_to h(attachment.filename), {:only_path => only_path, :controller => 'attachments', :action => 'download', :id => attachment},
:class => 'attachment'
end