diff --git a/app/controllers/base_controller.rb b/app/controllers/base_controller.rb index 7816066b8b..626307db49 100644 --- a/app/controllers/base_controller.rb +++ b/app/controllers/base_controller.rb @@ -15,8 +15,12 @@ class BaseController < ApplicationController private + def all_distributor_order_cycles_invalid? + OrderCycle.with_distributor(@distributor).active.all?(&:invalid?) + end + def set_order_cycles - unless @distributor.ready_for_checkout? + if !@distributor.ready_for_checkout? || all_distributor_order_cycles_invalid? @order_cycles = OrderCycle.where('false') return end