app/models/educode_sales/business.rb in educode_sales-0.9.7 vs app/models/educode_sales/business.rb in educode_sales-0.9.8
- old
+ new
@@ -1,7 +1,9 @@
module EducodeSales
class Business < ApplicationRecord
+ validates_uniqueness_of :number ,allow_nil: true
+
belongs_to :staff
belongs_to :department
belongs_to :last_follow_up, class_name: 'FollowUp', optional: true # 允许last_follow_up_id字段中的数为nil
has_many :sale_plans