summaryrefslogtreecommitdiffstats
path: root/app/controllers/projects_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2006-12-16 17:33:31 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2006-12-16 17:33:31 +0000
commit3e28dc669b014db811c0de673a090adf54f42bc1 (patch)
tree445375f87d67692e6072b33b2a1628a2c3117477 /app/controllers/projects_controller.rb
parentbee3f353fca4031268536c1cc4349014f5b8ac62 (diff)
downloadredmine-3e28dc669b014db811c0de673a090adf54f42bc1.tar.gz
redmine-3e28dc669b014db811c0de673a090adf54f42bc1.zip
various eager loadings added
git-svn-id: http://redmine.rubyforge.org/svn/trunk@98 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r--app/controllers/projects_controller.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index a31b7ec55..4151e734c 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -175,7 +175,7 @@ class ProjectsController < ApplicationController
# Show documents list of @project
def list_documents
- @documents = @project.documents
+ @documents = @project.documents.find :all, :include => :category
end
# Add a new issue to @project
@@ -398,7 +398,7 @@ class ProjectsController < ApplicationController
end
unless params[:show_news] == "0"
- @project.news.find(:all, :conditions => ["news.created_on>=? and news.created_on<=?", @date_from, @date_to] ).each { |i|
+ @project.news.find(:all, :conditions => ["news.created_on>=? and news.created_on<=?", @date_from, @date_to], :include => :author ).each { |i|
@events_by_day[i.created_on.to_date] ||= []
@events_by_day[i.created_on.to_date] << i
}
@@ -406,7 +406,7 @@ class ProjectsController < ApplicationController
end
unless params[:show_files] == "0"
- Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN versions ON versions.id = attachments.container_id", :conditions => ["attachments.container_type='Version' and versions.project_id=? and attachments.created_on>=? and attachments.created_on<=?", @project.id, @date_from, @date_to] ).each { |i|
+ Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN versions ON versions.id = attachments.container_id", :conditions => ["attachments.container_type='Version' and versions.project_id=? and attachments.created_on>=? and attachments.created_on<=?", @project.id, @date_from, @date_to], :include => :author ).each { |i|
@events_by_day[i.created_on.to_date] ||= []
@events_by_day[i.created_on.to_date] << i
}
@@ -418,7 +418,7 @@ class ProjectsController < ApplicationController
@events_by_day[i.created_on.to_date] ||= []
@events_by_day[i.created_on.to_date] << i
}
- Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN documents ON documents.id = attachments.container_id", :conditions => ["attachments.container_type='Document' and documents.project_id=? and attachments.created_on>=? and attachments.created_on<=?", @project.id, @date_from, @date_to] ).each { |i|
+ Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN documents ON documents.id = attachments.container_id", :conditions => ["attachments.container_type='Document' and documents.project_id=? and attachments.created_on>=? and attachments.created_on<=?", @project.id, @date_from, @date_to], :include => :author ).each { |i|
@events_by_day[i.created_on.to_date] ||= []
@events_by_day[i.created_on.to_date] << i
}