Fixed Address Finder last_used_ship_address. It now uses order.shipments.shipping_methods instead of order.shipping_method

This commit is contained in:
luisramos0
2018-09-14 16:43:20 +01:00
parent 692101db36
commit 2da7cc00f8

View File

@@ -79,7 +79,7 @@ module OpenFoodNetwork
def last_used_ship_address
return nil unless allow_search_by_email?
Spree::Order.complete.joins(:ship_address, :shipping_method).order('id DESC')
Spree::Order.complete.joins(:ship_address, shipments: :shipping_methods).order('id DESC')
.where(email: email, spree_shipping_methods: { require_ship_address: true })
.first.andand.ship_address
end