From 5169ee91ea7aed13bd36f5b9b1a26d7b3549d37b Mon Sep 17 00:00:00 2001 From: Andy Brett Date: Tue, 18 May 2021 10:42:19 -0700 Subject: [PATCH] add comment for before_action --- app/controllers/spree/admin/payments_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/spree/admin/payments_controller.rb b/app/controllers/spree/admin/payments_controller.rb index c4e4086bff..284830ecf0 100644 --- a/app/controllers/spree/admin/payments_controller.rb +++ b/app/controllers/spree/admin/payments_controller.rb @@ -9,6 +9,9 @@ module Spree before_action :load_payment, only: [:fire, :show] before_action :load_data before_action :can_transition_to_payment + # We ensure that items are in stock before all screens if the order is in the Payment state. + # This way, we don't allow someone to enter credit card details for an order only to be told + # that it can't be processed. before_action :ensure_sufficient_stock_lines respond_to :html