mirror of
https://github.com/projekteuler/projekteuler.git
synced 2025-12-10 08:46:41 +01:00
Prevent N+1 query on problem index
This commit is contained in:
parent
63bd0193ce
commit
d20b3e0fef
@ -2,7 +2,7 @@ class ProblemsController < ApplicationController
|
||||
before_action :set_problem, only: [:show]
|
||||
|
||||
def index
|
||||
@problems = Problem.paginate(page: params[:page])
|
||||
@problems = Problem.paginate(page: params[:page]).includes(:translation)
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
Loading…
Reference in New Issue
Block a user