changed way working times are returned. builtin protection if exercise is new
This commit is contained in:
@ -167,8 +167,8 @@ class ExercisesController < ApplicationController
|
||||
end
|
||||
|
||||
def working_times
|
||||
working_time_accumulated = Time.parse(@exercise.average_working_time_for_only(current_user.id) || "00:00:00").seconds_since_midnight
|
||||
working_time_avg = Time.parse(@exercise.average_working_time || "00:00:00").seconds_since_midnight
|
||||
working_time_accumulated = @exercise.accumulated_working_time_for_only(current_user.id)
|
||||
working_time_avg = @exercise.get_quantiles([0.75]).first
|
||||
render(json: {working_time_avg: working_time_avg, working_time_accumulated: working_time_accumulated})
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user