Associate customers again

And simplify the before_validation actions.
This commit is contained in:
Maikel Linke
2022-02-09 13:45:52 +11:00
parent 07314af3f6
commit d09ba16411
2 changed files with 3 additions and 4 deletions

View File

@@ -84,8 +84,7 @@ module Spree
before_validation :set_currency
before_validation :generate_order_number, on: :create
before_validation :clone_billing_address, if: :use_billing?
before_validation :associate_customer, unless: :customer_id?
before_validation :ensure_customer, unless: :customer_is_valid?
before_validation :ensure_customer
before_create :link_by_email
after_create :create_tax_charge!
@@ -715,6 +714,8 @@ module Spree
end
def create_customer
return if customer_is_valid?
Customer.create(
enterprise: distributor,
email: email_for_customer,

View File

@@ -948,8 +948,6 @@ describe Spree::Order do
end
it "associates an existing customer" do
pending "the last commit broke associating orders"
customer = create(
:customer,
user: user,