Project

General

Profile

Defect #7510 ยป attachments_reverse.patch

Ernad Husremovic, 2011-02-01 14:09

View differences:

app/helpers/application_helper.rb
end
when 'attachment'
attachments = options[:attachments] || (obj && obj.respond_to?(:attachments) ? obj.attachments : nil)
if attachments && attachment = attachments.detect {|a| a.filename == name }
if attachments && attachment = attachments.sort_by(&:created_on).reverse.detect {|a| a.filename == name }
link = link_to h(attachment.filename), {:only_path => only_path, :controller => 'attachments', :action => 'download', :id => attachment},
:class => 'attachment'
end
    (1-1/1)