mirror of
https://github.com/redmine/redmine.git
synced 2025-11-08 06:15:59 +01:00
Link to attachment should return latest attachment (#7510).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11196 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -774,7 +774,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_attachment(attachment, :only_path => only_path, :download => true, :class => 'attachment')
|
||||
end
|
||||
when 'project'
|
||||
|
||||
Reference in New Issue
Block a user