mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-02 02:11:33 +00:00
remove subquery for optimization
This commit is contained in:
@@ -24,8 +24,7 @@ module Permissions
|
||||
# Any orders that the user can edit
|
||||
def editable_orders
|
||||
orders = if @user.can_manage_line_items_in_orders_only?
|
||||
Spree::Order.joins(:distributor).where(
|
||||
id: produced_orders.select(:id),
|
||||
produced_orders.joins(:distributor).where(
|
||||
distributor: { enable_producers_to_edit_orders: true }
|
||||
)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user