mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Simplify customer association
This commit is contained in:
@@ -718,8 +718,6 @@ module Spree
|
||||
end
|
||||
|
||||
def find_customer
|
||||
return customer if customer.present?
|
||||
|
||||
Customer.of(distributor).find_by(email: email_for_customer)
|
||||
end
|
||||
|
||||
@@ -738,7 +736,7 @@ module Spree
|
||||
end
|
||||
|
||||
def ensure_customer
|
||||
self.customer = find_customer || create_customer
|
||||
self.customer ||= find_customer || create_customer
|
||||
end
|
||||
|
||||
def update_adjustment!(adjustment)
|
||||
|
||||
Reference in New Issue
Block a user