Refactor and reuse :not_state scope

This commit is contained in:
Pau Perez
2021-02-09 15:19:33 +01:00
parent d7ee7e02dd
commit a3b2a25ccf
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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])