app/controllers/spree/admin/search_controller.rb in spree_backend-2.4.10 vs app/controllers/spree/admin/search_controller.rb in spree_backend-3.0.0.rc1

- old
+ new

@@ -19,9 +19,21 @@ :bill_address_firstname_start => params[:q], :bill_address_lastname_start => params[:q] }).result.limit(10) end end + + def products + if params[:ids] + @products = Product.where(:id => params[:ids].split(",")) + else + @products = Product.ransack(params[:q]).result + end + + @products = @products.distinct.page(params[:page]).per(params[:per_page]) + expires_in 15.minutes, :public => true + headers['Surrogate-Control'] = "max-age=#{15.minutes}" + end end end end