mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-22 00:36:12 +01:00
Altered /todo/tag so that it only finds active actions, not completed ones.
Fixes #448 git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@447 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
96a6da0090
commit
341e1fa603
3 changed files with 21 additions and 16 deletions
|
|
@ -249,7 +249,7 @@ class TodosController < ApplicationController
|
|||
if tag_collection.empty?
|
||||
@todos = []
|
||||
else
|
||||
@todos = tag_collection.find(:all, :conditions => ['taggings.user_id = ?', @user.id])
|
||||
@todos = tag_collection.find(:all, :conditions => ['taggings.user_id = ? and state = ?', @user.id, 'active'])
|
||||
end
|
||||
|
||||
@count = @todos.size unless @todos.empty?
|
||||
|
|
|
|||
|
|
@ -5,15 +5,14 @@
|
|||
ActiveRecord::Schema.define(:version => 28) do
|
||||
|
||||
create_table "contexts", :force => true do |t|
|
||||
t.column "name", :string, :default => "", :null => false
|
||||
t.column "hide", :integer, :limit => 4, :default => 0, :null => false
|
||||
t.column "position", :integer, :default => 0, :null => false
|
||||
t.column "user_id", :integer, :default => 0, :null => false
|
||||
t.column "name", :string, :default => "", :null => false
|
||||
t.column "position", :integer, :default => 0, :null => false
|
||||
t.column "hide", :boolean, :default => false
|
||||
t.column "user_id", :integer, :default => 1
|
||||
t.column "created_at", :datetime
|
||||
t.column "updated_at", :datetime
|
||||
end
|
||||
|
||||
add_index "contexts", ["user_id"], :name => "index_contexts_on_user_id"
|
||||
add_index "contexts", ["user_id", "name"], :name => "index_contexts_on_user_id_and_name"
|
||||
|
||||
create_table "notes", :force => true do |t|
|
||||
|
|
@ -65,14 +64,13 @@ ActiveRecord::Schema.define(:version => 28) do
|
|||
create_table "projects", :force => true do |t|
|
||||
t.column "name", :string, :default => "", :null => false
|
||||
t.column "position", :integer, :default => 0, :null => false
|
||||
t.column "user_id", :integer, :default => 0, :null => false
|
||||
t.column "user_id", :integer, :default => 1
|
||||
t.column "description", :text
|
||||
t.column "state", :string, :limit => 20, :default => "active", :null => false
|
||||
t.column "created_at", :datetime
|
||||
t.column "updated_at", :datetime
|
||||
end
|
||||
|
||||
add_index "projects", ["user_id"], :name => "index_projects_on_user_id"
|
||||
add_index "projects", ["user_id", "name"], :name => "index_projects_on_user_id_and_name"
|
||||
|
||||
create_table "sessions", :force => true do |t|
|
||||
|
|
@ -101,16 +99,16 @@ ActiveRecord::Schema.define(:version => 28) do
|
|||
add_index "tags", ["name"], :name => "index_tags_on_name"
|
||||
|
||||
create_table "todos", :force => true do |t|
|
||||
t.column "context_id", :integer, :default => 0, :null => false
|
||||
t.column "description", :string, :limit => 100, :default => "", :null => false
|
||||
t.column "context_id", :integer, :default => 0, :null => false
|
||||
t.column "project_id", :integer
|
||||
t.column "description", :string, :default => "", :null => false
|
||||
t.column "notes", :text
|
||||
t.column "created_at", :datetime
|
||||
t.column "due", :date
|
||||
t.column "completed_at", :datetime
|
||||
t.column "project_id", :integer
|
||||
t.column "user_id", :integer, :default => 0, :null => false
|
||||
t.column "user_id", :integer, :default => 1
|
||||
t.column "show_from", :date
|
||||
t.column "state", :string, :limit => 20, :default => "immediate", :null => false
|
||||
t.column "state", :string, :limit => 20, :default => "immediate", :null => false
|
||||
end
|
||||
|
||||
add_index "todos", ["user_id", "state"], :name => "index_todos_on_user_id_and_state"
|
||||
|
|
@ -120,10 +118,10 @@ ActiveRecord::Schema.define(:version => 28) do
|
|||
add_index "todos", ["user_id", "context_id"], :name => "index_todos_on_user_id_and_context_id"
|
||||
|
||||
create_table "users", :force => true do |t|
|
||||
t.column "login", :string, :limit => 80
|
||||
t.column "password", :string, :limit => 40
|
||||
t.column "login", :string, :limit => 80, :default => "", :null => false
|
||||
t.column "password", :string, :limit => 40, :default => "", :null => false
|
||||
t.column "word", :string
|
||||
t.column "is_admin", :integer, :limit => 4, :default => 0, :null => false
|
||||
t.column "is_admin", :boolean, :default => false, :null => false
|
||||
t.column "first_name", :string
|
||||
t.column "last_name", :string
|
||||
t.column "auth_type", :string, :default => "database", :null => false
|
||||
|
|
|
|||
7
tracks/test/fixtures/taggings.yml
vendored
7
tracks/test/fixtures/taggings.yml
vendored
|
|
@ -20,3 +20,10 @@ foo:
|
|||
taggable_id: 2 # Call dinosaur exterminator
|
||||
taggable_type: Todo
|
||||
user_id: 1
|
||||
|
||||
foo:
|
||||
id: 4
|
||||
tag_id: 1
|
||||
taggable_id: 3 # Buy milk - completed
|
||||
taggable_type: Todo
|
||||
user_id: 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue