mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-09 03:20:21 +00:00
Fix multiple results with 'inventory_items_shipment_id_null' ransack query
The q['inventory_items_shipment_id_null'] search element was generating duplicates where there were multiple line items on an order that were ready to be shipped, with id = null
This commit is contained in:
@@ -26,11 +26,11 @@ class SearchOrders
|
||||
@search = OpenFoodNetwork::Permissions.new(current_user).editable_orders.ransack(params[:q])
|
||||
|
||||
return paginated_results if using_pagination?
|
||||
@search.result
|
||||
@search.result(distinct: true)
|
||||
end
|
||||
|
||||
def paginated_results
|
||||
@search.result
|
||||
@search.result(distinct: true)
|
||||
.page(params[:page])
|
||||
.per(params[:per_page])
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user