Commit d71d6ab
Changed files (2)
app
models
app/models/exercise_set.rb
@@ -3,6 +3,7 @@ class ExerciseSet < ActiveRecord::Base
belongs_to :workout
scope :for, ->(exercise) { where(exercise: exercise).order(:created_at) }
scope :successful, -> { where('actual_repetitions = target_repetitions') }
+ scope :work, -> { where(type: WorkSet.name) }
def work?
type == WorkSet.name
app/models/progress.rb
@@ -15,6 +15,6 @@ class Progress
end
def sets
- workout.sets.where(exercise: exercise).order(:created_at)
+ workout.sets.work.where(exercise: exercise).order(:created_at)
end
end