Commit d71d6ab

mo khan <mo@mokhan.ca>
2016-07-01 14:44:33
only show work sets on listing.
1 parent 71ad00f
Changed files (2)
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