@@ -2,7 +2,7 @@ class Promotion < ActiveRecord::Base
has_paper_trail
self.table_name = "promotions"
validates :begin_time,:end_time,:name,:order_type, presence: true
- has_and_belongs_to_many :depart_record, :foreign_key => :depart
+ has_and_belongs_to_many :depart_record
def prodcut1
prd1 = Product.where("id = ?", self.prod1).first