项目动态数更新

This commit is contained in:
cxt 2016-01-14 11:38:46 +08:00
parent 27617044a1
commit c63af51001
1 changed files with 2 additions and 1 deletions

View File

@ -20,7 +20,8 @@ class ForgeActivity < ActiveRecord::Base
validates :forge_act_id,presence: true validates :forge_act_id,presence: true
validates :forge_act_type, presence: true validates :forge_act_type, presence: true
has_many :user_acts, :class_name => 'UserAcivity',:as =>:act has_many :user_acts, :class_name => 'UserAcivity',:as =>:act
after_save :add_user_activity, :add_org_activity, :add_acts_count after_save :add_user_activity, :add_org_activity
after_create :add_acts_count
before_destroy :destroy_user_activity, :destroy_org_activity, :decrease_acts_count before_destroy :destroy_user_activity, :destroy_org_activity, :decrease_acts_count
#在个人动态里面增加当前动态 #在个人动态里面增加当前动态