From 9fda0da8209b9d487a4022a70583f3c8025ba54c Mon Sep 17 00:00:00 2001 From: friflaj Date: Thu, 27 May 2010 12:51:06 +0200 Subject: [PATCH] Add task status on story --- app/models/story.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/models/story.rb b/app/models/story.rb index 1dfa875e71..9a2b5e5add 100644 --- a/app/models/story.rb +++ b/app/models/story.rb @@ -61,4 +61,17 @@ class Story < Issue return story_points.to_s end + + def task_status + closed = 0 + open = 0 + self.descendants.each {|task| + if task.closed? + closed += 1 + else + open += 1 + end + } + return {:open => open, :closed => closed} + end end