diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-12-03 23:05:45 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-12-03 23:05:45 +0000 |
commit | d00014221ed1a5666b2eb5952c15242613421562 (patch) | |
tree | 453c25b49bca6078b833c276df087af8d67c63a9 /app | |
parent | 3b4cfe0ba8b4ea2ac36e0db36632afe3d042eb5a (diff) | |
download | redmine-d00014221ed1a5666b2eb5952c15242613421562.tar.gz redmine-d00014221ed1a5666b2eb5952c15242613421562.zip |
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
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects_controller.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 658e9d232..c4d1b53fc 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -442,7 +442,7 @@ class ProjectsController < ApplicationController end 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 if @scope.include?('messages') |