From 630a344296c1b3bc377a5f5d5265b8dc41831ab3 Mon Sep 17 00:00:00 2001 From: Richard Lynch Date: Tue, 1 Oct 2024 11:21:35 +0100 Subject: [PATCH] Remove unused eager loading --- app/controllers/admin/payroll_runs_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/payroll_runs_controller.rb b/app/controllers/admin/payroll_runs_controller.rb index 1604cd1a3a..5b2e75c096 100644 --- a/app/controllers/admin/payroll_runs_controller.rb +++ b/app/controllers/admin/payroll_runs_controller.rb @@ -46,7 +46,7 @@ def create # NOTE: Optimisation - preload payments, claims and eligibility def show - @payroll_run = PayrollRun.where(id: params[:id]).includes({claims: [:eligibility]}, {payments: [{claims: [:eligibility]}]}).first + @payroll_run = PayrollRun.find(params[:id]) @pagy, @payments = pagy(@payroll_run.payments.ordered.includes(claims: [:eligibility]).includes(:topups)) end