mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-11 23:17:48 +00:00
Move helper to service for re-use
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
module OrdersHelper
|
||||
def order_paid_via(order)
|
||||
# frozen_string_literal: true
|
||||
|
||||
module OrderPaymentFinder
|
||||
def self.last_payment_method(order)
|
||||
# `sort_by` avoids additional database queries when payments are loaded
|
||||
# already. There is usually only one payment and this shouldn't cause
|
||||
# any overhead compared to `order(:updated_at)`.
|
||||
@@ -13,9 +13,9 @@
|
||||
.pad
|
||||
.text-big
|
||||
= t :order_payment
|
||||
%strong= order_paid_via(order).andand.name
|
||||
%strong= OrderPaymentFinder.last_payment_method(order).andand.name
|
||||
%p.text-small.text-skinny.pre-line
|
||||
%em= order_paid_via(order).andand.description
|
||||
%em= OrderPaymentFinder.last_payment_method(order).andand.description
|
||||
|
||||
.order-summary.text-small
|
||||
%strong
|
||||
|
||||
Reference in New Issue
Block a user