Remove dead code in Admin::ProductsController

This is related to some of the data-loading for index actions inherited from Spree's Admin::ResourceController, but we don't actually use it any more...
This commit is contained in:
Matt-Yorkley
2021-06-28 19:03:12 +01:00
parent e5bdaa603a
commit 1dddaf9b14

View File

@@ -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