app/models/educode_sales/business.rb in educode_sales-0.9.99 vs app/models/educode_sales/business.rb in educode_sales-1.0.0

- old
+ new

@@ -10,21 +10,21 @@ belongs_to :p_staff, class_name: 'Staff', optional: true belongs_to :p_sale_staff, class_name: 'Staff', optional: true belongs_to :p_deleter, class_name: 'Staff', optional: true - belongs_to :place, class_name: 'Place', optional: true - belongs_to :customer, class_name: 'Department', optional: true - belongs_to :activity, class_name: 'Activity', optional: true - has_many :sale_plans has_many :follow_ups has_many :business_clazz_changes has_many :business_levels, dependent: :destroy has_many :business_watches, dependent: :destroy has_many :business_histories, dependent: :destroy + belongs_to :sourcable, :polymorphic => true, optional: true + has_many :assign_staffs, as: :sourcable, dependent: :destroy # 售后人员 + + enum source_way: ['会议活动', '公司资源', '400电话', '商务邮箱', '渠道代理', '合作伙伴', '招标信息', '客户', '朋友'] # 关联关注 has_many :users, :class_name => 'EducodeSales::BusinessRelationShip', foreign_key: 'business_id', :dependent => :destroy # 每次查询时 默认的查询条件