summaryrefslogtreecommitdiff
path: root/app/models/exercise.rb
blob: 0794dcab49d78b9e2c5fb2c69cd1d1aa2f44c1c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Exercise < ApplicationRecord
  PRIMARY_LIFTS=["Squat", "Bench Press", "Barbell Row", "Overhead Press", "Deadlift"]

  scope :primary, ->() { where(name: PRIMARY_LIFTS) }
  scope :order_by_name, ->() { order(name: :asc) }

  def short_name
    name.gsub(/[^A-Z]/, "")
  end

  def slug
    name.parameterize
  end
end