From 2e5810d64de0deb3eb2011b634de527254e61f75 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 30 Dec 2020 11:36:36 +0000 Subject: [PATCH] Fix more Rubocop offences --- .../spree/admin/payments/paypal_refund.html.haml | 14 ++++++++------ .../payments/source_views/_paypal.html.haml | 16 +++++++++------- lib/spree/api/controller_setup.rb | 2 ++ 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/app/views/spree/admin/payments/paypal_refund.html.haml b/app/views/spree/admin/payments/paypal_refund.html.haml index d9855483bf..38f308fdaa 100644 --- a/app/views/spree/admin/payments/paypal_refund.html.haml +++ b/app/views/spree/admin/payments/paypal_refund.html.haml @@ -1,20 +1,22 @@ -= render :partial => 'spree/admin/shared/order_tabs', :locals => { :current => 'Payments' } += render partial: 'spree/admin/shared/order_tabs', locals: { current: 'Payments' } + - content_for :page_title do %i.icon-arrow-right = link_to Spree.t(:payments), admin_order_payments_path(@order) %i.icon-arrow-right = payment_method_name(@payment) %i.icon-arrow-right - = Spree.t('refund', :scope => :paypal) + = Spree.t('refund', scope: :paypal) + = form_tag paypal_refund_admin_order_payment_path(@order, @payment) do .label-block.left.five.columns.alpha %div %fieldset{"data-hook" => "admin_variant_new_form"} - %legend= Spree.t('refund', :scope => :paypal) + %legend= Spree.t('refund', scope: :paypal) .field - = label_tag 'refund_amount', Spree.t(:refund_amount, :scope => 'paypal') + = label_tag 'refund_amount', Spree.t(:refund_amount, scope: 'paypal') %small - %em= Spree.t(:original_amount, :scope => 'paypal', :amount => @payment.display_amount) + %em= Spree.t(:original_amount, scope: 'paypal', amount: @payment.display_amount) %br/ - symbol = ::Money.new(1, Spree::Config[:currency]).symbol - if Spree::Config[:currency_symbol_position] == "before" @@ -23,4 +25,4 @@ - else = text_field_tag 'refund_amount', @payment.amount = symbol - = button Spree.t(:refund, :scope => 'paypal'), 'icon-dollar' + = button Spree.t(:refund, scope: 'paypal'), 'icon-dollar' diff --git a/app/views/spree/admin/payments/source_views/_paypal.html.haml b/app/views/spree/admin/payments/source_views/_paypal.html.haml index f6bfa4a3cc..4636995466 100644 --- a/app/views/spree/admin/payments/source_views/_paypal.html.haml +++ b/app/views/spree/admin/payments/source_views/_paypal.html.haml @@ -1,14 +1,14 @@ %fieldset{"data-hook" => "paypal"} - %legend{align: "center"}= Spree.t(:transaction, :scope => :paypal) + %legend{align: "center"}= Spree.t(:transaction, scope: :paypal) .row .alpha.six.columns %dl %dt - = Spree.t(:payer_id, :scope => :paypal) + = Spree.t(:payer_id, scope: :paypal) \: %dd= payment.source.payer_id %dt - = Spree.t(:token, :scope => :paypal) + = Spree.t(:token, scope: :paypal) \: %dd= payment.source.token %dt @@ -16,19 +16,21 @@ \: %dd= payment.source.transaction_id - if payment.source.state != 'refunded' - = button_link_to Spree.t('actions.refund', :scope => :paypal), spree.paypal_refund_admin_order_payment_path(@order, payment), :icon => 'icon-dollar' + = button_link_to Spree.t('actions.refund', scope: :paypal), + spree.paypal_refund_admin_order_payment_path(@order, payment), + icon: 'icon-dollar' - else .alpha.six.columns %dl %dt - = Spree.t(:state, :scope => :paypal) + = Spree.t(:state, scope: :paypal) \: %dd= payment.source.state.titleize %dt - = Spree.t(:refunded_at, :scope => :paypal) + = Spree.t(:refunded_at, scope: :paypal) \: %dd= pretty_time(payment.source.refunded_at) %dt - = Spree.t(:refund_transaction_id, :scope => :paypal) + = Spree.t(:refund_transaction_id, scope: :paypal) \: %dd= payment.source.refund_transaction_id diff --git a/lib/spree/api/controller_setup.rb b/lib/spree/api/controller_setup.rb index 3371677563..010ce77b1e 100644 --- a/lib/spree/api/controller_setup.rb +++ b/lib/spree/api/controller_setup.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spree/core/controller_helpers/auth' module Spree