At some point, the completed actions listing at the bottom of the home page and the context and project pages had acquired a strange sort order. I've changed it back to sorting by descending completion date, so that the last action completed is at the top.

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@271 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
bsag 2006-06-29 17:38:13 +00:00
parent 13e2a13ca5
commit 654409439f
3 changed files with 3 additions and 3 deletions

View file

@ -306,7 +306,7 @@ class TodoController < ApplicationController
@projects = @user.projects
@contexts = @user.contexts
@todos = Todo.find(:all, :conditions => ['user_id = ? and type = ?', @user.id, "Immediate"])
@done = Todo.find(:all, :conditions => ['user_id = ? and done = ?', @user.id, true])
@done = Todo.find(:all, :conditions => ['user_id = ? and done = ?', @user.id, true], :order => 'completed DESC')
# @todos = @todos.collect { |x| (x.class == Immediate) ? x : nil }.compact
end

View file

@ -26,7 +26,7 @@ class Context < ActiveRecord::Base
def find_done_todos
todos = Todo.find :all, :conditions => ["todos.context_id = #{id} AND todos.done = ? AND type = ?", true, "Immediate"],
:include => [:context, :project],
:order => "due IS NULL, due ASC, created_at ASC",
:order => "completed DESC",
:limit => @user.preferences["no_completed"].to_i
end

View file

@ -33,7 +33,7 @@ class Project < ActiveRecord::Base
def find_done_todos
todos = Todo.find :all, :conditions => ["project_id = #{id} AND done = ?", true],
:order => "due IS NULL, due ASC, created_at ASC",
:order => "completed DESC",
:limit => @user.preferences["no_completed"].to_i
end