]> source.dussan.org Git - redmine.git/commitdiff
Order is already defined on attachments association.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 1 Jan 2012 17:35:34 +0000 (17:35 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 1 Jan 2012 17:35:34 +0000 (17:35 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8458 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/document.rb

index 208b1087636f7135824ba5fa468373eabdff1ad7..0917f8449af85b43b0a8a698e6bc2f57e4a585c4 100644 (file)
@@ -45,7 +45,7 @@ class Document < ActiveRecord::Base
 
   def updated_on
     unless @updated_on
-      a = attachments.find(:first, :order => 'created_on DESC')
+      a = attachments.last
       @updated_on = (a && a.created_on) || created_on
     end
     @updated_on