blob: 91d7339067872762c35f81d594c5b61fd40d5349 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
class Progress
attr_reader :exercise, :workout
def initialize(workout, exercise)
@exercise = exercise
@workout = workout
end
def to_sets
@sets ||= sets.pluck(:actual_repetitions).compact
end
def max_weight
sets.maximum(:target_weight)
end
def sets
workout.sets.work.for(exercise).in_order
end
def status
"#{to_sets.join('/')} @ #{max_weight} lbs" if to_sets.any?
end
end
|