class Routine < ApplicationRecord
	#
	before_save SafeUrl.new
	# relations
	belongs_to :plan, optional: true
	has_many :routine_workouts, dependent: :destroy
	has_many :workouts, through: :routine_workouts
	accepts_nested_attributes_for :routine_workouts, :allow_destroy => true
	#
	default_scope { order(number: :asc) }

	attr_accessor :workout_selector

end