Skip to content

Commit

Permalink
Merge pull request #7842 from obregonia1/fix-n-plus-one
Browse files Browse the repository at this point in the history
N+1 が発行されていたので対応
  • Loading branch information
komagata authored Jun 24, 2024
2 parents 5286a88 + b7bdf4a commit 8217b8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/courses/practices_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Courses::PracticesController < ApplicationController
def index
@course = Course.find(params[:course_id])
@categories = @course.categories.order(:created_at)
@categories = @course.categories.includes(practices: %i[practices_books learning_minute_statistic started_students]).order(:created_at)
@learnings = current_user.learnings
end
end

0 comments on commit 8217b8d

Please sign in to comment.