mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fixed Address Finder last_used_ship_address. It now uses order.shipments.shipping_methods instead of order.shipping_method
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user