mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Reference product attributes for sorting correctly
The previous version failed in some cases as it relied on a table name generated by Rails.
This commit is contained in:
@@ -37,7 +37,9 @@ module OpenFoodNetwork
|
||||
ransack(search_params.merge(m: 'or')).
|
||||
result.
|
||||
includes(:product).
|
||||
order("products_spree_variants.name, display_name, display_as, products_spree_variants.variant_unit_name")
|
||||
merge(Spree::Product.order(:name)).
|
||||
order(:display_name, :display_as).
|
||||
merge(Spree::Product.order(:variant_unit_name))
|
||||
end
|
||||
|
||||
def distributor
|
||||
|
||||
Reference in New Issue
Block a user