解决留言消息提示中遗留的bug

This commit is contained in:
huang 2015-08-11 15:26:41 +08:00
parent 4589016027
commit 5f87d5806b
2 changed files with 3 additions and 3 deletions

View File

@ -163,7 +163,7 @@ class Journal < ActiveRecord::Base
# Description 公共表中需要保存一份该记录
def act_as_forge_activity
self.forge_acts << ForgeActivity.new(:user_id => self.user_id,
:project_id => self.issue.project.id)
:project_id => self.issue.project.id)
end

View File

@ -258,7 +258,7 @@ class User < Principal
###添加留言 fq
def add_jour(user, notes, reference_user_id = 0, options = {})
if options.count == 0
self.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id, :status => true)
self.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id, :status => true, :is_readed => false)
else
jfm = self.journals_for_messages.build(options)
jfm.save
@ -294,7 +294,7 @@ class User < Principal
# 查询用户未读过的记录
def count_new_jour
count = self.journals_for_messages.where("status=?", 1).count
count = self.journals_for_messages.where("status=? and is_readed = ? " ,1, 0).count
end
#added by nie