From 1b86ccb82c573cda97d3a48f126b64bc5105b9e3 Mon Sep 17 00:00:00 2001 From: bsag Date: Sun, 4 Feb 2007 16:34:17 +0000 Subject: [PATCH] Made the sort order of actions on the home page consistent with that on the context and project pages. Actions with the nearest due date (or the most overdue) appear at the top, followed by actions with no due date which are sorted by creation date with the newest at the bottom. Fixes #428 git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@427 a4c988fc-2ded-0310-b66e-134b36920a42 --- tracks/app/controllers/todos_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracks/app/controllers/todos_controller.rb b/tracks/app/controllers/todos_controller.rb index d230f26d..b482c568 100644 --- a/tracks/app/controllers/todos_controller.rb +++ b/tracks/app/controllers/todos_controller.rb @@ -286,7 +286,7 @@ class TodosController < ApplicationController @todos = @user.todos.find(:all, :conditions => ['todos.state = ? or todos.state = ?', 'active', 'complete'], :include => [ :project, :context ]) # Exclude hidden projects from the home page - @not_done_todos = @user.todos.find(:all, :conditions => ['todos.state = ?', 'active'], :order => "todos.due ASC", :include => [ :project, :context ]) + @not_done_todos = @user.todos.find(:all, :conditions => ['todos.state = ?', 'active'], :order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC", :include => [ :project, :context ]) end def determine_down_count