Include and joins after the order seems in order to select fields...

...that are in the order by
This commit is contained in:
Jean-Baptiste Bellet
2021-12-15 10:11:51 +01:00
parent 0cc4e5728e
commit a33ebbdc85

View File

@@ -36,10 +36,9 @@ module OpenFoodNetwork
includes(option_values: :option_type).
ransack(search_params.merge(m: 'or')).
result.
order("spree_products.name, display_name, display_as, spree_products.variant_unit_name").
includes(:product).
merge(Spree::Product.order(:name)).
order(:display_name, :display_as).
merge(Spree::Product.order(:variant_unit_name))
joins(:product)
end
def distributor