Module: Shop::Models::User

Defined in:
lib/shop/models/user.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/shop/models/user.rb', line 5

def self.included(base)
  base.class_eval do
    has_one    :billing,  :class_name => 'ShopBilling',   :as => :addressable
    has_one    :shipping, :class_name => 'ShopShipping',  :as => :addressable
    has_many   :orders,   :class_name => 'ShopOrder',     :foreign_key => :customer_id
    
    accepts_nested_attributes_for :orders, :shipping, :billing
  end
end