From 09e0f64de7672dc55089902cafc170b737e33a2c Mon Sep 17 00:00:00 2001 From: Craig Maloney Date: Wed, 12 Oct 2011 23:22:44 -0300 Subject: [PATCH] Changing the default sort order so that the context view matches the home screen view. This appears to override the todos_controller.rb order. --- app/models/context.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/context.rb b/app/models/context.rb index cc5f6253..2a797397 100644 --- a/app/models/context.rb +++ b/app/models/context.rb @@ -1,6 +1,7 @@ class Context < ActiveRecord::Base - has_many :todos, :dependent => :delete_all, :include => :project, :order => "todos.completed_at DESC" + has_many :todos, :dependent => :delete_all, :include => :project, + :order => 'todos.due IS NULL, todos.due ASC, todos.created_at ASC' has_many :recurring_todos, :dependent => :delete_all belongs_to :user