Order is already defined on attachments association.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8458 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
d84660c823
commit
cd256fe89f
|
@ -45,7 +45,7 @@ class Document < ActiveRecord::Base
|
||||||
|
|
||||||
def updated_on
|
def updated_on
|
||||||
unless @updated_on
|
unless @updated_on
|
||||||
a = attachments.find(:first, :order => 'created_on DESC')
|
a = attachments.last
|
||||||
@updated_on = (a && a.created_on) || created_on
|
@updated_on = (a && a.created_on) || created_on
|
||||||
end
|
end
|
||||||
@updated_on
|
@updated_on
|
||||||
|
|
Loading…
Reference in New Issue