Show last update datetime (last attachment added) on document list (#4232).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3095 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-11-26 20:12:20 +00:00
parent f3bcb705f7
commit 43fd27fd0c
6 changed files with 44 additions and 5 deletions
+8
View File
@@ -34,4 +34,12 @@ class Document < ActiveRecord::Base
self.category ||= DocumentCategory.default
end
end
def updated_on
unless @updated_on
a = attachments.find(:first, :order => 'created_on DESC')
@updated_on = (a && a.created_on) || created_on
end
@updated_on
end
end