From a332f8f5575789a937143e4f536ad81c45bb94c3 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Wed, 14 Sep 2011 14:22:30 +0200 Subject: [PATCH] fix #1196. You can now transition from pending to project_hidden One side effect though: althoug dependencies are still in place, the gui cannot differentiate between pending and hidden todos. The views currently do not show dependencies anymore in hidden projects. Postponing a fix for 2.2 Signed-off-by: Reinier Balt --- app/models/todo.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/todo.rb b/app/models/todo.rb index 5b9710a5..b93ca342 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -80,11 +80,12 @@ class Todo < ActiveRecord::Base end aasm_event :hide do - transitions :to => :project_hidden, :from => [:active, :deferred] + transitions :to => :project_hidden, :from => [:active, :deferred, :pending] end aasm_event :unhide do transitions :to => :deferred, :from => [:project_hidden], :guard => Proc.new{|t| !t.show_from.blank? } + transitions :to => :pending, :from => [:project_hidden], :guard => :uncompleted_predecessors? transitions :to => :active, :from => [:project_hidden] end