mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Refactor and reuse :not_state scope
This commit is contained in:
@@ -131,7 +131,7 @@ module Spree
|
||||
}
|
||||
|
||||
scope :not_state, lambda { |state|
|
||||
where("state != ?", state)
|
||||
where.not(state: state)
|
||||
}
|
||||
|
||||
# All the states an order can be in after completing the checkout
|
||||
|
||||
@@ -49,7 +49,7 @@ module OpenFoodNetwork
|
||||
if FeatureToggle.enabled?(:customer_balance, @user)
|
||||
Spree::Order.
|
||||
finalized.
|
||||
where.not(spree_orders: { state: :canceled }).
|
||||
not_state(:canceled).
|
||||
distributed_by_user(@user).
|
||||
managed_by(@user).
|
||||
search(params[:q])
|
||||
|
||||
Reference in New Issue
Block a user