2014-11-09 21:53:39 +00:00
|
|
|
class Order < ActiveRecord::Base
|
2014-11-25 20:34:29 +00:00
|
|
|
belongs_to :user
|
2014-11-25 13:27:27 +00:00
|
|
|
has_many :order_products
|
|
|
|
has_many :products, through: :order_products
|
|
|
|
|
2014-11-10 21:57:37 +00:00
|
|
|
default_scope -> { order('created_at DESC') }
|
2014-11-25 01:01:57 +00:00
|
|
|
|
2014-11-09 21:53:39 +00:00
|
|
|
end
|