Skip to content
Browse files

Hi, my name is Kyle. I have a Bachelors degree in Civil Engineering a…

…nd spent half my life in math classes. Oh, BTW - I can't calculate slope
  • Loading branch information...
1 parent 79a974d commit 29f717350eee59324e8420dc0df25d5769d24011 @kneath committed May 4, 2009
Showing with 1 addition and 2 deletions.
  1. +1 −2 views/timeline.erb
View
3 views/timeline.erb
@@ -28,8 +28,7 @@
else
events = events.to_a
last_events = events.size > 7 ? events.slice(-7, 7) : events.slice(-1*events.size, events.size - 1)
- avg = last_events.inject{|sum, e| (sum.is_a?(Fixnum) ? sum : 0) + e.ticket_change }.to_f/([last_events.size, 7].min)
- rate = avg*-1
+ rate = (last_events.last.num_tickets_open - last_events.first.num_tickets_open).to_f/last_events.size
@estimated_rate[events.object_id] = rate
end
value = @last_value.nil? ? 0 : @last_value - rate

0 comments on commit 29f7173

Please sign in to comment.
Something went wrong with that request. Please try again.