From 58fbf5e66f3bea4f8fa9b4c6638dc2d36dc328a4 2008-10-18 10:18:21 From: Jean-Philippe Lang Date: 2008-10-18 10:18:21 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 --- diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0a4aab2..2fdc119 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