app/models/user.rb
## total duration from all exercise workouts
total duration from all exercise workouts
total duration from all exercise workouts
def total
     count = 0
     self.total_time_exercise_workouts.each do |ex|
       count += ex.duration
     end
     count
   end
def total count = 0 self . total_time_exercise_workouts . each do | ex | count += ex . duration end count end
total duration from all exercise workouts
total duration from all exercise workouts