Module: Skr::Concerns::IsOrderLike::InstanceMethods

Defined in:
lib/skr/concerns/is_order_like.rb

Instance Method Summary collapse

Instance Method Details

#customer=(cust) ⇒ Object

Set’s the customer. It also defaults the terms, addresses,and tax_exempt status to the customer’s defaults



13
14
15
16
17
18
19
# File 'lib/skr/concerns/is_order_like.rb', line 13

def customer=(cust)
    super
    self.terms ||= cust.terms
    self.is_tax_exempt    = cust.is_tax_exempt        if     self.is_tax_exempt.nil?
    self.billing_address  = cust.billing_address.dup  unless self.billing_address.present?
    self.shipping_address = cust.shipping_address.dup unless self.shipping_address.present?
end