mirror of
https://github.com/redmine/redmine.git
synced 2025-11-02 11:25:55 +01:00
bug fixed in projects/activity due to sql join
documents added in projects/activity git-svn-id: http://redmine.rubyforge.org/svn/trunk@84 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -389,7 +389,7 @@ class ProjectsController < ApplicationController
|
||||
end
|
||||
|
||||
unless params[:show_files] == "0"
|
||||
Attachment.find(:all, :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] ).each { |i|
|
||||
@events_by_day[i.created_on.to_date] ||= []
|
||||
@events_by_day[i.created_on.to_date] << i
|
||||
}
|
||||
@@ -397,7 +397,11 @@ class ProjectsController < ApplicationController
|
||||
end
|
||||
|
||||
unless params[:show_documents] == "0"
|
||||
Attachment.find(:all, :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|
|
||||
@project.documents.find(:all, :conditions => ["documents.created_on>=? and documents.created_on<=?", @date_from, @date_to] ).each { |i|
|
||||
@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|
|
||||
@events_by_day[i.created_on.to_date] ||= []
|
||||
@events_by_day[i.created_on.to_date] << i
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user