From 58fbf5e66f3bea4f8fa9b4c6638dc2d36dc328a4 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 18 Oct 2008 10:18:21 +0000 Subject: [PATCH] Show the most recent file when displaying an inline image. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@1939 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0a4aab2b..2fdc119c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -241,6 +241,7 @@ module ApplicationHelper attachments = options[:attachments] || (obj && obj.respond_to?(:attachments) ? obj.attachments : nil) if attachments + attachments = attachments.sort_by(&:created_on).reverse text = text.gsub(/!((\<|\=|\>)?(\([^\)]+\))?(\[[^\]]+\])?(\{[^\}]+\})?)(\S+\.(gif|jpg|jpeg|png))!/) do |m| style = $1 filename = $6