Prevent N+1 query on problem index

This commit is contained in:
pfischbeck committed 2014-12-30 17:59:39 +01:00
1 parent 63bd0193ce
commit d20b3e0fef
1 file changed
+1 -1
+1 -1
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