|
@@ -3,7 +3,7 @@ class BalancePromotion < ActiveRecord::Base
|
|
|
self.table_name = "balance_promotions"
|
|
self.table_name = "balance_promotions"
|
|
|
belongs_to :depart_record, :foreign_key => :depart
|
|
belongs_to :depart_record, :foreign_key => :depart
|
|
|
|
|
|
|
|
- validates :begin_time,:end_time,:name, presence: true
|
|
|
|
|
|
|
+ validates :begin_time,:end_time,:name,:depart,:min_total,:max_total, presence: true
|
|
|
validate :product_validation
|
|
validate :product_validation
|
|
|
def product_validation
|
|
def product_validation
|
|
|
if self.send_prod1 > 0
|
|
if self.send_prod1 > 0
|