From 8236b35cee218f5a3ccb6beafa1672b9778a667c Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Mon, 14 Oct 2013 15:13:19 +1100 Subject: [PATCH] [backend] Added eager loading for variant + product to stock movements/index --- .../app/controllers/spree/admin/stock_movements_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/app/controllers/spree/admin/stock_movements_controller.rb b/backend/app/controllers/spree/admin/stock_movements_controller.rb index d37911e8a9e..897a440785f 100644 --- a/backend/app/controllers/spree/admin/stock_movements_controller.rb +++ b/backend/app/controllers/spree/admin/stock_movements_controller.rb @@ -5,7 +5,9 @@ class StockMovementsController < Spree::Admin::BaseController helper_method :stock_location def index - @stock_movements = stock_location.stock_movements.recent.page(params[:page]) + @stock_movements = stock_location.stock_movements.recent. + includes(:stock_item => { :variant => :product }). + page(params[:page]) end def new