Add archived to dashboard and change homepage to only show active (ie not archived) courses

This commit is contained in:
2024-02-04 13:35:28 +00:00
parent 04566509dc
commit 4485624f79
3 changed files with 13 additions and 4 deletions
+2
View File
@@ -6,6 +6,8 @@ class Course < ApplicationRecord
# we them independently to avoid re-importing lectures.
has_many :recordings, dependent: :destroy
scope :active, -> { where(archived: false) }
def lectures_and_work_items
(lectures + work_items).sort_by(&:start_time)
end