mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-25 11:38:49 +01:00
Removing a single-line method
This commit is contained in:
parent
5e6b82c3e5
commit
ff54506e7f
1 changed files with 1 additions and 5 deletions
|
|
@ -42,7 +42,7 @@ class StatsController < ApplicationController
|
|||
|
||||
def interpolate_avg_for_current_month(set)
|
||||
percent_of_month = Time.zone.now.day.to_f / Time.zone.now.end_of_month.day.to_f
|
||||
interpolate_avg(set, percent_of_month)
|
||||
(set[0]*(1/percent_of_month) + set[1] + set[2]) / 3.0
|
||||
end
|
||||
|
||||
def actions_done_last_years
|
||||
|
|
@ -450,10 +450,6 @@ class StatsController < ApplicationController
|
|||
(set.fetch(i,0) + set.fetch(i+1,0) + set.fetch(i+2,0)) / 3.0
|
||||
end
|
||||
|
||||
def interpolate_avg(set, percent)
|
||||
(set[0]*(1/percent) + set[1] + set[2]) / 3.0
|
||||
end
|
||||
|
||||
# sets "null" on first column and - if necessary - cleans up last two columns, which may have insufficient data
|
||||
def compute_running_avg_array(set, upper_bound)
|
||||
result = Array.new(upper_bound) { |i| three_month_avg(set, i) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue