@@ -1,6 +1,7 @@
class Product < ActiveRecord::Base
has_paper_trail
self.table_name = 'products'
+ Product = Product.where("id = ?", 1).first
belongs_to :product_cat, :foreign_key => :category_id
belongs_to :merchant, :foreign_key => :merchant_id
validates :name,:buy_price,:price,:category_id,:count,:robo_balance_price, presence: true