diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-01-01 17:35:34 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-01-01 17:35:34 +0000 |
commit | cd256fe89f8432b6e1edd20bd389b7695087724d (patch) | |
tree | 4c66c0a78d91a906aadcc5b40b0b39a0d5dd56e5 /app/models/document.rb | |
parent | d84660c823757336e846fe602ed0aa52865c9346 (diff) | |
download | redmine-cd256fe89f8432b6e1edd20bd389b7695087724d.tar.gz redmine-cd256fe89f8432b6e1edd20bd389b7695087724d.zip |
Order is already defined on attachments association.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8458 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/document.rb')
-rw-r--r-- | app/models/document.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/document.rb b/app/models/document.rb index 208b10876..0917f8449 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -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 |