]> source.dussan.org Git - redmine.git/commitdiff
Show the most recent file when displaying an inline image.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 18 Oct 2008 10:18:21 +0000 (10:18 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 18 Oct 2008 10:18:21 +0000 (10:18 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@1939 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb

index 0a4aab2b987cce2fd7bd24a4931ade492d67fb9b..2fdc119c1be6603f24043d88a8cb15145eaf2775 100644 (file)
@@ -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