mirror of
https://github.com/projekteuler/projekteuler.git
synced 2026-01-27 02:28:50 +01:00
Prevent N+1 query on problem index
This commit is contained in:
@@ -2,7 +2,7 @@ class ProblemsController < ApplicationController
|
|||||||
before_action :set_problem, only: [:show]
|
before_action :set_problem, only: [:show]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@problems = Problem.paginate(page: params[:page])
|
@problems = Problem.paginate(page: params[:page]).includes(:translation)
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|||||||
Reference in New Issue
Block a user