修改部分项目关注不能及时更新Bug

This commit is contained in:
linhk 2014-09-05 11:22:10 +08:00
parent e99f9250c3
commit 20b8bf00b6
2 changed files with 7 additions and 7 deletions

View File

@ -12,7 +12,7 @@ class ProjectStatus < ActiveRecord::Base
# 但是 如果超级用户删除其他用户的话会造成读取错误 这里是遗漏点
# 删除用户时 此表创建人员未作相应删除动作
def update_watchers_count(num)
if self.watchers_count >= 0
if self.watchers_count||0 >= 0
self.update_attribute(:watchers_count, self.watchers_count.to_i + num)
end
end