mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Simplify backorderable priority SQL query in product sorting concern
This commit is contained in:
@@ -13,7 +13,7 @@ module ProductSortByStocks
|
||||
)")
|
||||
|
||||
@backorderable_priority_sql = Arel.sql("(
|
||||
SELECT CASE WHEN BOOL_OR(si.backorderable) = true THEN 1 ELSE 0 END
|
||||
SELECT BOOL_OR(si.backorderable)
|
||||
FROM spree_variants v
|
||||
JOIN spree_stock_items si ON si.variant_id = v.id
|
||||
WHERE v.product_id = spree_products.id
|
||||
|
||||
Reference in New Issue
Block a user