diff --git a/app/models/spree/order.rb b/app/models/spree/order.rb index 9d7429a42d..a81264f0c4 100644 --- a/app/models/spree/order.rb +++ b/app/models/spree/order.rb @@ -81,17 +81,16 @@ module Spree before_validation :associate_customer, unless: :customer_id? before_validation :ensure_customer, unless: :customer_is_valid? - validates :customer, presence: true, if: :require_customer? - validate :products_available_from_new_distribution, if: lambda { - distributor_id_changed? || order_cycle_id_changed? - } - validate :disallow_guest_order - attr_accessor :use_billing before_create :link_by_email after_create :create_tax_charge! + validates :customer, presence: true, if: :require_customer? + validate :products_available_from_new_distribution, if: lambda { + distributor_id_changed? || order_cycle_id_changed? + } + validate :disallow_guest_order validates :email, presence: true, format: /\A([\w.%+\-']+)@([\w\-]+\.)+(\w{2,})\z/i, if: :require_email