diff --git a/app/controllers/spree/admin/products_controller.rb b/app/controllers/spree/admin/products_controller.rb index 4da21bc7eb..9aae19e015 100644 --- a/app/controllers/spree/admin/products_controller.rb +++ b/app/controllers/spree/admin/products_controller.rb @@ -127,26 +127,7 @@ module Spree end def collection - return @collection if @collection.present? - - params[:q] ||= {} - params[:q][:deleted_at_null] ||= "1" - - params[:q][:s] ||= "name asc" - @collection = Spree::Product - @collection = @collection.with_deleted if params[:q].delete(:deleted_at_null).blank? - # @search needs to be defined as this is passed to search_form_for - @search = @collection.ransack(params[:q]) - @collection = @search.result. - managed_by(spree_current_user). - group_by_products_id. - includes(product_includes) - - if params[:q][:s].include?("master_default_price_amount") - # PostgreSQL compatibility - @collection = @collection.group("spree_prices.amount") - end - @collection + nil end def product_includes