修复留言计分

This commit is contained in:
z9hang 2014-07-01 10:31:44 +08:00
parent 33c883146a
commit 0bcc0beaf1
1 changed files with 9 additions and 0 deletions

View File

@ -117,6 +117,15 @@ class JournalsForMessage < ActiveRecord::Base
update_all("m_reply_count = #{count.to_i}", ["id = ?", journals_for_messages.m_parent_id])
end
#如果是在项目中留言则返回该项目否则返回nil - zjc
def project
if self.jour_type == 'Project'
Project.find(self.jour_id)
else
nil
end
end
# 更新用户分数 -by zjc
def be_user_score
#新建了留言回复