\r
# Show documents list of @project
def list_documents\r
- @documents = @project.documents\r
+ @documents = @project.documents.find :all, :include => :category\r
end\r
\r
# Add a new issue to @project\r
end\r
\r
unless params[:show_news] == "0"\r
- @project.news.find(:all, :conditions => ["news.created_on>=? and news.created_on<=?", @date_from, @date_to] ).each { |i|\r
+ @project.news.find(:all, :conditions => ["news.created_on>=? and news.created_on<=?", @date_from, @date_to], :include => :author ).each { |i|\r
@events_by_day[i.created_on.to_date] ||= []\r
@events_by_day[i.created_on.to_date] << i\r
}\r
end\r
\r
unless params[:show_files] == "0"\r
- 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|\r
+ 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|\r
@events_by_day[i.created_on.to_date] ||= []\r
@events_by_day[i.created_on.to_date] << i\r
}\r
@events_by_day[i.created_on.to_date] ||= []\r
@events_by_day[i.created_on.to_date] << i\r
}\r
- 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|\r
+ 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|\r
@events_by_day[i.created_on.to_date] ||= []\r
@events_by_day[i.created_on.to_date] << i\r
}\r
has_many :members, :dependent => true\r
has_many :users, :through => :members\r
has_many :custom_values, :dependent => true, :as => :customized\r
- has_many :issues, :dependent => true, :order => "issues.created_on DESC", :include => :status\r
+ has_many :issues, :dependent => true, :order => "issues.created_on DESC", :include => [:status, :tracker]\r
has_many :queries, :dependent => true\r
has_many :documents, :dependent => true\r
has_many :news, :dependent => true, :include => :author\r