summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-10-18 10:18:21 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-10-18 10:18:21 +0000
commit58fbf5e66f3bea4f8fa9b4c6638dc2d36dc328a4 (patch)
treeb0293e10243ac115a3372b6b597cc516f8acc85c
parentccbe48d7791175497f516a341597a78736f79666 (diff)
downloadredmine-58fbf5e66f3bea4f8fa9b4c6638dc2d36dc328a4.tar.gz
redmine-58fbf5e66f3bea4f8fa9b4c6638dc2d36dc328a4.zip
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
-rw-r--r--app/helpers/application_helper.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 0a4aab2b9..2fdc119c1 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