From 2da7cc00f83929db7def5ff98e20aa675cca376f Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Fri, 14 Sep 2018 16:43:20 +0100 Subject: [PATCH] Fixed Address Finder last_used_ship_address. It now uses order.shipments.shipping_methods instead of order.shipping_method --- lib/open_food_network/address_finder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/open_food_network/address_finder.rb b/lib/open_food_network/address_finder.rb index 6c19f153bd..49d3242667 100644 --- a/lib/open_food_network/address_finder.rb +++ b/lib/open_food_network/address_finder.rb @@ -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