Changesets retrieval optimization on the activity view. Prevents additional query from being executed for each displayed changeset.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@952 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2007-12-03 23:05:45 +00:00
parent 3b4cfe0ba8
commit d00014221e
1 changed files with 1 additions and 1 deletions

View File

@ -442,7 +442,7 @@ class ProjectsController < ApplicationController
end end
if @scope.include?('changesets') if @scope.include?('changesets')
@events += @project.repository.changesets.find(:all, :conditions => ["#{Changeset.table_name}.committed_on BETWEEN ? AND ?", @date_from, @date_to]) @events += Changeset.find(:all, :include => :repository, :conditions => ["#{Repository.table_name}.project_id = ? AND #{Changeset.table_name}.committed_on BETWEEN ? AND ?", @project.id, @date_from, @date_to])
end end
if @scope.include?('messages') if @scope.include?('messages')