Added some database optimizations, mostly in the form of indices on commonly queried columns

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@396 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2007-01-11 05:29:29 +00:00
parent ead9a4cfe9
commit d8ec265ca4
6 changed files with 48 additions and 11 deletions

View file

@ -155,7 +155,7 @@ class ContextController < ApplicationController
# TODO: Temporarily doing this search manually until I can work out a way
# to do the same thing using not_done_todos acts_as_todo_container method
# Hides actions in hidden projects from context.
@not_done_todos = @context.todos.find_in_state(:all, :active, :order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC")
@not_done_todos = @context.todos.find(:all, :conditions => ['todos.state = ?', 'active'], :order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC", :include => :project)
@count = @not_done_todos.size
end