On Wed, Jan 11, 2012 at 09:42:32AM -0500, Tzu-Mainn Chen wrote:
---
src/app/models/instance_task.rb | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/src/app/models/instance_task.rb b/src/app/models/instance_task.rb
index 41b3352..d28e0e6 100644
--- a/src/app/models/instance_task.rb
+++ b/src/app/models/instance_task.rb
@@ -73,13 +73,9 @@ class InstanceTask < Task
# FIXME if we allow actions based on the expected state after
# automatic transitions, we need to call this method again with
# the state from transition.to passed in.
- unless transition.action.nil?
- add_action = true
- if (instance and user)
- # FIXME: check permissions here if we filter actions by permission
- end
- actions << transition.action if add_action
- end
+ next unless transition.action
+ next if instance.state == Instance::STATE_PENDING
+ actions << transition.action
end
end
actions
--
ACK.
It's always a good day when you implement a new feature and yet manage
to remove more code than you added.
-- Matt