diff --git a/app/services/order_payment_finder.rb b/app/services/order_payment_finder.rb index 7011941cf7..7040db3c6c 100644 --- a/app/services/order_payment_finder.rb +++ b/app/services/order_payment_finder.rb @@ -7,6 +7,6 @@ module OrderPaymentFinder # any overhead compared to `order(:updated_at)`. # # Using `last` without sort is not deterministic. - order.payments.sort_by(&:updated_at).last.andand.payment_method + order.payments.sort_by(&:updated_at).last&.payment_method end end diff --git a/app/views/spree/shared/_order_details.html.haml b/app/views/spree/shared/_order_details.html.haml index 2a9c6ee266..22c8ccdf8f 100644 --- a/app/views/spree/shared/_order_details.html.haml +++ b/app/views/spree/shared/_order_details.html.haml @@ -13,9 +13,9 @@ .pad .text-big = t :order_payment - %strong= OrderPaymentFinder.last_payment_method(order).andand.name + %strong= OrderPaymentFinder.last_payment_method(order)&.name %p.text-small.text-skinny.pre-line - %em= OrderPaymentFinder.last_payment_method(order).andand.description + %em= OrderPaymentFinder.last_payment_method(order)&.description .order-summary.text-small %strong