From 55d7d5d1e4876f35798cdfa63c94ea7148e095c4 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 2 Oct 2018 11:10:51 +0100 Subject: [PATCH] Rename #capture_path to #payment_capture_path --- app/serializers/api/admin/order_serializer.rb | 4 ++-- app/views/spree/admin/orders/index.html.haml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/serializers/api/admin/order_serializer.rb b/app/serializers/api/admin/order_serializer.rb index 7ea181da5d..e3207b30fd 100644 --- a/app/serializers/api/admin/order_serializer.rb +++ b/app/serializers/api/admin/order_serializer.rb @@ -2,7 +2,7 @@ class Api::Admin::OrderSerializer < ActiveModel::Serializer attributes :id, :number, :full_name, :email, :phone, :completed_at, :display_total attributes :show_path, :edit_path, :state, :payment_state, :shipment_state attributes :payments_path, :shipments_path, :ship_path, :ready_to_ship, :created_at - attributes :distributor_name, :special_instructions, :capture_path + attributes :distributor_name, :special_instructions, :payment_capture_path has_one :distributor, serializer: Api::Admin::IdSerializer has_one :order_cycle, serializer: Api::Admin::IdSerializer @@ -39,7 +39,7 @@ class Api::Admin::OrderSerializer < ActiveModel::Serializer spree_routes_helper.fire_admin_order_path(object, e: 'ship') end - def capture_path + def payment_capture_path pending_payment = object.pending_payments.first return '' unless object.payment_required? && pending_payment spree_routes_helper.fire_admin_order_payment_path(object, pending_payment.id, e: 'capture') diff --git a/app/views/spree/admin/orders/index.html.haml b/app/views/spree/admin/orders/index.html.haml index 5aa6f161b8..5c8f0e8d14 100644 --- a/app/views/spree/admin/orders/index.html.haml +++ b/app/views/spree/admin/orders/index.html.haml @@ -68,8 +68,8 @@ %a.icon_link.with-tip.icon-edit.no-text{'ng-href' => '{{::order.edit_path}}', 'data-action' => 'edit', 'ofn-with-tip' => t('.edit')} %div{'ng-if' => 'order.ready_to_ship'} %a.icon-road.icon_link.with-tip.no-text{'ng-href' => '{{::order.ship_path}}', 'data-action' => 'ship', 'data-confirm' => t(:are_you_sure), 'data-method' => 'put', rel: 'nofollow', 'ofn-with-tip' => t('.ship')} - %div{'ng-if' => 'order.capture_path'} - %a.icon-capture.icon_link.no-text{'ng-href' => '{{::order.capture_path}}', 'data-action' => 'capture', 'data-method' => 'put', rel: 'nofollow', 'ofn-with-tip' => t('.capture')} + %div{'ng-if' => 'order.payment_capture_path'} + %a.icon-capture.icon_link.no-text{'ng-href' => '{{::order.payment_capture_path}}', 'data-action' => 'capture', 'data-method' => 'put', rel: 'nofollow', 'ofn-with-tip' => t('.capture')} .orders-loading{'ng-show' => 'RequestMonitor.loading'} .row