pull/6827/head
friflaj 15 years ago
parent 773bdfff97
commit 2e46d59d1c
  1. 10
      app/models/sprint.rb
  2. 4
      lib/issue_patch.rb
  3. 9
      lib/project_patch.rb

@ -47,6 +47,16 @@ class Sprint < Version
return (self.sprint_start_date .. cutoff).select {|d| (d.wday > 0 and d.wday < 6) }
end
def eta
return nil if ! self.start_date
v = self.project.velocity
return nil if ! v or ! v[:days_per_point]
# assume 5 out of 7 are working days
return self.start_date + Integer(self.points * v[:days_per_point] * 7.0/5)
end
def has_burndown
return !!(self.effective_date and self.sprint_start_date)
end

@ -77,9 +77,9 @@ module IssuePatch
return nil if !self.is_story? || ! self.story_points || self.story_points <= 0
v = self.project.velocity
return nil if ! v or ! v[:velocity] or v[:velocity] <= 0
return nil if ! v or ! v[:days_per_point]
return self.story_points * (v[:days] / v[:velocity])
return Integer(self.story_points * v[:days_per_point])
end
def update_parent_attributes_with_remaining_hours

@ -26,7 +26,14 @@ module ProjectPatch
days += sprint.days.length
accepted += (sprint.stories.select{|s| s.status.is_closed && s.story_points}.inject(0){|sum, s| sum + s.story_points}) || 0
}
return {:date => most_recent, :sprints => sprints.length, :days => days / sprints.length, :velocity => accepted / sprints.length }
velo = {:date => most_recent,
:sprints => sprints.length,
:days => days / sprints.length,
:velocity => accepted / sprints.length}
if velo[:velocity] and velo[:velocity] >= 0
velo[:days_per_point] = (velo[:days] * 1.0) / velo[:velocity]
end
return velo
end
end

Loading…
Cancel
Save