summaryrefslogtreecommitdiffstats
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-15 21:08:27 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-15 21:08:27 +0000
commit93e0885b64d82b42e028f68ad6f8e15dede7c781 (patch)
treee248fe9d1b671f50f21a35f2fb3ab0d7e313e483 /app/helpers/application_helper.rb
parent48c3785991f789f34171dfd687b30664c8915a73 (diff)
downloadredmine-93e0885b64d82b42e028f68ad6f8e15dede7c781.tar.gz
redmine-93e0885b64d82b42e028f68ad6f8e15dede7c781.zip
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
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index e181eea54..f923b7b6c 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -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'