lib/saga/planning.rb in saga-0.8.0 vs lib/saga/planning.rb in saga-0.8.1

- old
+ new

@@ -5,11 +5,11 @@ def initialize(document) @document = document end def iterations - @document.stories.values.flatten.inject({}) do |properties, story| + @document.stories_as_flat_list.inject({}) do |properties, story| if story[:estimate] iteration = story[:iteration] || -1 properties[iteration] ||= BLANK_ITERATION.dup properties[iteration][:story_count] += 1 properties[iteration][:estimate_total_in_hours] += self.class.estimate_to_hours(story[:estimate]) @@ -27,25 +27,21 @@ total end def unestimated unestimated = 0 - @document.stories.values.each do |stories| - stories.each do |story| - unestimated += 1 unless story[:estimate] - end + @document.stories_as_flat_list.each do |story| + unestimated += 1 unless story[:estimate] end unestimated end def statusses statusses = {} - @document.stories.values.each do |stories| - stories.each do |story| - if story[:estimate] and story[:status] - statusses[story[:status]] ||= 0 - statusses[story[:status]] += self.class.estimate_to_hours(story[:estimate]) - end + @document.stories_as_flat_list.each do |story| + if story[:estimate] and story[:status] + statusses[story[:status]] ||= 0 + statusses[story[:status]] += self.class.estimate_to_hours(story[:estimate]) end end statusses end \ No newline at end of file