mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
revert "remove subquery for optimization"
- we are using OR between two queries here: 53ec6621bc/app/services/search_orders.rb (L31-L32)
- so to make it compatible with this, had to revert
Throws following error:
Relation passed to #or must be structurally compatible. Incompatible values: [:left_outer_joins]
This commit is contained in:
@@ -24,7 +24,8 @@ module Permissions
|
||||
# Any orders that the user can edit
|
||||
def editable_orders
|
||||
orders = if @user.can_manage_line_items_in_orders_only?
|
||||
produced_orders.joins(:distributor).where(
|
||||
Spree::Order.joins(:distributor).where(
|
||||
id: produced_orders.select(:id),
|
||||
distributor: { enable_producers_to_edit_orders: true }
|
||||
)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user