mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Replace conditional with a guard clause
This commit is contained in:
@@ -19,14 +19,14 @@ module OrderStockCheck
|
||||
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')
|
||||
return unless current_order_cycle&.closed?
|
||||
|
||||
redirect_to main_app.shop_path
|
||||
end
|
||||
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
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user