From 631f9fe6ffd161df00224648f4ce7c6343e571c9 Mon Sep 17 00:00:00 2001 From: lrbalt Date: Tue, 18 Mar 2008 21:15:41 +0000 Subject: [PATCH] removes getting completed todos when generating home page. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@749 a4c988fc-2ded-0310-b66e-134b36920a42 --- tracks/app/controllers/todos_controller.rb | 2 +- tracks/db/schema.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tracks/app/controllers/todos_controller.rb b/tracks/app/controllers/todos_controller.rb index 87654b0e..839955e6 100644 --- a/tracks/app/controllers/todos_controller.rb +++ b/tracks/app/controllers/todos_controller.rb @@ -411,7 +411,7 @@ class TodosController < ApplicationController # current_users.todos.find but that broke with_scope for :limit # Exclude hidden projects from count on home page - @todos = Todo.find(:all, :conditions => ['todos.user_id = ? and todos.state = ? or todos.state = ?', current_user.id, 'active', 'completed'], :include => [ :project, :context, :tags ]) + @todos = Todo.find(:all, :conditions => ['todos.user_id = ? and todos.state = ?', current_user.id, 'active'], :include => [ :project, :context, :tags ]) # Exclude hidden projects from the home page @not_done_todos = Todo.find(:all, :conditions => ['todos.user_id = ? and todos.state = ? AND contexts.hide = ? AND (projects.state = ? OR todos.project_id IS NULL)', current_user.id, 'active', false, 'active'], :order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC", :include => [ :project, :context, :tags ]) diff --git a/tracks/db/schema.rb b/tracks/db/schema.rb index aa23c217..30485695 100644 --- a/tracks/db/schema.rb +++ b/tracks/db/schema.rb @@ -6,7 +6,7 @@ ActiveRecord::Schema.define(:version => 38) do create_table "contexts", :force => true do |t| t.column "name", :string, :default => "", :null => false - t.column "position", :integer, :default => 0 + t.column "position", :integer t.column "hide", :boolean, :default => false t.column "user_id", :integer, :default => 1 t.column "created_at", :datetime @@ -69,7 +69,7 @@ ActiveRecord::Schema.define(:version => 38) do create_table "projects", :force => true do |t| t.column "name", :string, :default => "", :null => false - t.column "position", :integer, :default => 0 + t.column "position", :integer t.column "user_id", :integer, :default => 1 t.column "description", :text t.column "state", :string, :limit => 20, :default => "active", :null => false