Memoize selected_payment_method

This commit is contained in:
Matt-Yorkley
2022-01-19 22:17:37 +00:00
parent 02590014ab
commit 167adb3ddc

View File

@@ -63,7 +63,7 @@ class SplitCheckoutController < ::BaseController
end
def selected_payment_method
@order.payments.order(:created_at).last&.payment_method
@selected_payment_method ||= @order.payments.order(:created_at).last&.payment_method
end
def update_order