From 5ce3e1e0d2f880bc2e226fc40594a1b6437fd4c8 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 4 Feb 2020 10:50:12 +0000 Subject: [PATCH] Fix some rubocop issues in checkout controller --- .rubocop_manual_todo.yml | 1 - app/controllers/checkout_controller.rb | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.rubocop_manual_todo.yml b/.rubocop_manual_todo.yml index f88da549cb..b9ea90c49f 100644 --- a/.rubocop_manual_todo.yml +++ b/.rubocop_manual_todo.yml @@ -372,7 +372,6 @@ Metrics/AbcSize: - app/controllers/spree/admin/taxons_controller.rb - app/controllers/spree/admin/users_controller.rb - app/controllers/spree/admin/variants_controller.rb - - app/controllers/spree/checkout_controller.rb - app/controllers/spree/credit_cards_controller.rb - app/controllers/spree/orders_controller.rb - app/controllers/spree/user_passwords_controller.rb diff --git a/app/controllers/checkout_controller.rb b/app/controllers/checkout_controller.rb index 3f6733be8a..122cca9e13 100644 --- a/app/controllers/checkout_controller.rb +++ b/app/controllers/checkout_controller.rb @@ -82,11 +82,11 @@ class CheckoutController < Spree::StoreController render json: { path: order_path(@order) }, status: :ok end end - rescue Spree::Core::GatewayError => error + rescue Spree::Core::GatewayError => e # This is done for all actions in the Spree::CheckoutController. - rescue_from_spree_gateway_error(error) - rescue StandardError => error - Bugsnag.notify(error) + rescue_from_spree_gateway_error(e) + rescue StandardError => e + Bugsnag.notify(e) flash[:error] = I18n.t("checkout.failed") update_failed end @@ -204,7 +204,7 @@ class CheckoutController < Spree::StoreController def setup_for_current_state method_name = :"before_#{@order.state}" - send(method_name) if respond_to?(method_name, true) + __send__(method_name) if respond_to?(method_name, true) end def before_address