|
@@ -2,6 +2,8 @@
|
|
|
class Product < ActiveRecord::Base
|
|
class Product < ActiveRecord::Base
|
|
|
has_paper_trail
|
|
has_paper_trail
|
|
|
self.table_name = 'products'
|
|
self.table_name = 'products'
|
|
|
|
|
+ devise_for :admins
|
|
|
|
|
+
|
|
|
#Thread.current[:current_user] = @current_user
|
|
#Thread.current[:current_user] = @current_user
|
|
|
scope :active, -> { where(ptype: "cent_sale") }
|
|
scope :active, -> { where(ptype: "cent_sale") }
|
|
|
scope :inactive, -> { where(ptype: "direct_sale") }
|
|
scope :inactive, -> { where(ptype: "direct_sale") }
|