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