mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user