mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-11 23:17:48 +00:00
Remove select from relation
This relation is only used above for a call to empty? so we don't need to worry about the select part of the query, specially not introducing an expensive DISTINCT
This commit is contained in:
@@ -31,8 +31,7 @@ class Api::Admin::ForOrderCycle::EnterpriseSerializer < ActiveModel::Serializer
|
||||
products_relation = object.supplied_products
|
||||
if order_cycle.prefers_product_selection_from_coordinator_inventory_only?
|
||||
products_relation = products_relation.
|
||||
visible_for(order_cycle.coordinator).
|
||||
select('DISTINCT spree_products.*')
|
||||
visible_for(order_cycle.coordinator)
|
||||
end
|
||||
products_relation
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user