courseplatform/app/models/week.rb

10 lines
234 B
Ruby

# frozen_string_literal: true
class Week < ApplicationRecord
belongs_to :course
scope :by_course, ->(c_id) { where(course_id: c_id) }
scope :name_asc, -> { order('name ASC') }
scope :name_desc, -> { order('name DESC') }
end