Commit ec260430b924fd7f8fcb9499aa8aba70569e0363

less 1+N queries on dashboard

Commit diff

app/controllers/site_controller.rb

 
1010 @projects = current_user.projects
1111 project_ids = @projects.map(&:id)
1212 @recent_comments = Comment.find(:all, :limit => 10,
13 :conditions => ["project_id in (?)", project_ids], :order => "created_at desc")
13 :conditions => ["comments.project_id in (?)", project_ids],
14 :order => "comments.created_at desc", :include => [:user, :repository])
1415 @repository_clones = @projects.map(&:repository_clones).flatten
1516 # @repository_clones = Repository.find(:all,
1617 # :conditions => ["project_id in (?) and mainline = ?", project_ids, false])
toggle raw diff