Project

General

Profile

Defect #34999 » fix_attachment_test2.diff

Pavel Rosický, 2021-04-04 13:49

View differences:

app/models/attachment.rb
370 370
  def self.latest_attach(attachments, filename)
371 371
    return unless filename.valid_encoding?
372 372

  
373
    attachments.sort_by(&:created_on).reverse.detect do |att|
373
    attachments.sort_by{|attachment| [attachment.created_on, attachment.id]}.reverse.detect do |att|
374 374
      filename.casecmp?(att.filename)
375 375
    end
376 376
  end
(2-2/2)