Sha256: 5ed7c4dec46f7faf3f3029d6c6566406348e54db50c56a135e5c29dcd081c6d0

Contents?: true

Size: 399 Bytes

Versions: 1

Compression:

Stored size: 399 Bytes

Contents

class ShopCustomer < User
  include Scoped::Models::User::Scoped
  
  has_many  :orders,        :class_name => 'ShopOrder'
  has_many  :billings,      :through => :orders
  has_many  :shippings,     :through => :orders
  
  accepts_nested_attributes_for :orders, :allow_destroy => true
  
  def first_name
    self.name.split(' ')[0]
  end
  
  def last_name
    self.name.split(' ')[1]
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
radiant-shop-extension-0.10.0 app/models/shop_customer.rb