diff --git a/app/services/shops_list_service.rb b/app/services/shops_list_service.rb index d276f57ae8..e145eedc93 100644 --- a/app/services/shops_list_service.rb +++ b/app/services/shops_list_service.rb @@ -1,15 +1,17 @@ # frozen_string_literal: true class ShopsListService + # shops that are ready for checkout, and have an order cycle that is currently open def open_shops shops_list. ready_for_checkout. - distributors_with_active_order_cycles. - all + distributors_with_active_order_cycles end + # shops that are either not ready for checkout, or don't have an open order cycle; the inverse of + # #open_shops def closed_shops - shops_list.not_ready_for_checkout.all + shops_list.where.not(id: open_shops.reselect("enterprises.id")) end private