We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f882c2f commit e768ca9Copy full SHA for e768ca9
1 file changed
app/controllers/api/lessons_controller.rb
@@ -10,8 +10,11 @@ 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
ordered_scope = scope.order(created_at: :asc)
13
- lessons_with_users = ordered_scope.accessible_by(current_ability).with_users
14
- remixes = user_remixes(ordered_scope)
+ accessible_lessons = ordered_scope.accessible_by(current_ability)
+ lessons_with_users = accessible_lessons.with_users
15
+ remixes = user_remixes(accessible_lessons)
16
+ pp lessons_with_users
17
+ pp remixes
18
@lessons_with_users_and_remixes = lessons_with_users.zip(remixes)
19
render :index, formats: [:json], status: :ok
20
end
0 commit comments