Skip to content

Commit

Permalink
Merge pull request #2657 from jhawthorn/deprecate_payment_method_name
Browse files Browse the repository at this point in the history
Deprecate payment_method_name helper
  • Loading branch information
jhawthorn authored Apr 3, 2018
2 parents 7a042d6 + 67307e9 commit 6cf05d0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions backend/app/helpers/spree/admin/payments_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Spree
module Admin
module PaymentsHelper
def payment_method_name(payment)
Spree::Deprecation.warn "payment_method_name(payment) is deprecated. Instead use payment.payment_method.name"
payment.payment_method.name
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<%= payment.display_amount.to_html %>
</td>
<td>
<%= payment_method_name(payment) %>
<%= payment.payment_method.name %>
</td>
<td>
<%= payment.transaction_id %>
Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/payments/_list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<tr id="<%= dom_id(payment) %>" data-hook="payments_row" class="payment vertical-middle" data-payment-id="<%= payment.id %>">
<td><%= link_to payment.number, spree.admin_order_payment_path(@order, payment) %></td>
<td><%= l(payment.created_at, format: :short) %></td>
<td><%= payment_method_name(payment) %></td>
<td><%= payment.payment_method.name %></td>
<td><%= payment.transaction_id %></td>
<td>
<span class="pill pill-<%= payment.state %>">
Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/payments/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<% admin_breadcrumb(link_to plural_resource_name(Spree::Payment), spree.admin_order_payments_path(@order)) %>
<% admin_breadcrumb do %>
<%= payment_method_name(@payment) %>
<%= @payment.payment_method.name %>
<span class="pill pill-<%= @payment.state %>">
<%= t(@payment.state, scope: 'spree.payment_states') %>
</span>
Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/shared/_refunds.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<td><%= pretty_time(refund.created_at) %></td>
<td><%= refund.payment.number %></td>
<td class="amount"><%= refund.display_amount %></td>
<td><%= payment_method_name(refund.payment) %></td>
<td><%= refund.payment.payment_method.name %></td>
<td><%= refund.transaction_id %></td>
<td><%= truncate(refund.reason.name, length: 100) %></td>
<% if show_actions %>
Expand Down

0 comments on commit 6cf05d0

Please sign in to comment.