1
0
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:
Philipp Fischbeck 2014-12-30 17:59:39 +01:00
parent 63bd0193ce
commit d20b3e0fef

View File

@ -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