We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 972f1cd commit 1caa3e8Copy full SHA for 1caa3e8
app/controllers/api/lessons_controller.rb
@@ -9,7 +9,8 @@ class LessonsController < ApiController
9
def index
10
archive_scope = params[:include_archived] == 'true' ? Lesson : Lesson.unarchived
11
scope = params[:school_class_id] ? archive_scope.where(school_class_id: params[:school_class_id]) : archive_scope
12
- @lessons_with_users = scope.accessible_by(current_ability).with_users
+ ordered_scope = scope.order(created_at: :asc)
13
+ @lessons_with_users = ordered_scope.accessible_by(current_ability).with_users
14
render :index, formats: [:json], status: :ok
15
end
16
0 commit comments