mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Memoize Spree::PaypalController#payment_method
This gets called 4 or 5 times in a single request just to read basic attributes from the object. The query doesn't need to be repeated each time
This commit is contained in:
@@ -67,7 +67,7 @@ Spree::PaypalController.class_eval do
|
||||
private
|
||||
|
||||
def payment_method
|
||||
Spree::PaymentMethod.find(params[:payment_method_id])
|
||||
@payment_method ||= Spree::PaymentMethod.find(params[:payment_method_id])
|
||||
end
|
||||
|
||||
def permit_parameters!
|
||||
|
||||
Reference in New Issue
Block a user