Eager-load users.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2009 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2008-11-11 12:50:11 +00:00
1 parent 4ed95ffff6
commit e8d0c26e43
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -78,7 +78,7 @@ class Repository < ActiveRecord::Base
# Default behaviour: we search in cached changesets
def changesets_for_path(path)
path = "/#{path}" unless path.starts_with?('/')
Change.find(:all, :include => :changeset,
Change.find(:all, :include => {:changeset => :user},
:conditions => ["repository_id = ? AND path = ?", id, path],
:order => "committed_on DESC, #{Changeset.table_name}.id DESC").collect(&:changeset)
end