Add order to supplied products in enterprise serializer so that products in exchanges are sorted alphabetically

This commit is contained in:
luisramos0
2019-11-10 20:02:39 +00:00
parent 1c7237869a
commit 6e51be095b

View File

@@ -38,7 +38,7 @@ class Api::Admin::ForOrderCycle::EnterpriseSerializer < ActiveModel::Serializer
if order_cycle.prefers_product_selection_from_coordinator_inventory_only?
products_relation = products_relation.visible_for(order_cycle.coordinator)
end
products_relation
products_relation.order(:name)
end
def products