Move #check_order_cycle_expiry method to OrderStockCheck and don't call it from BaseController :before_action callback

This commit is contained in:
Matt-Yorkley
2022-01-29 12:10:55 +00:00
parent 6dac65ace5
commit 5e6dd1e6e1
5 changed files with 25 additions and 25 deletions

View File

@@ -139,17 +139,6 @@ class ApplicationController < ActionController::Base
!current_distributor.ready_for_checkout?
end
def check_order_cycle_expiry
if current_order_cycle&.closed?
Bugsnag.notify("Notice: order cycle closed during checkout completion", order: current_order)
current_order.empty!
current_order.set_order_cycle! nil
flash[:info] = I18n.t('order_cycle_closed')
redirect_to main_app.shop_path
end
end
# All render calls within the block will be performed with the specified format
# Useful for rendering html within a JSON response, particularly if the specified
# template or partial then goes on to render further partials without specifying