博客回复发送的消息,点击之后没有自动更新为已读
This commit is contained in:
parent
0d1738cf91
commit
cb5548c853
|
@ -39,6 +39,9 @@ class BlogCommentsController < ApplicationController
|
|||
end
|
||||
end
|
||||
def show
|
||||
# 更新博客消息为已读
|
||||
update_messsages_to_viewed("BlogMessage", params[:blog_id])
|
||||
|
||||
@article = BlogComment.find(params[:id])
|
||||
@replies = BlogComment.where("root_id = #{@article.id}").reorder("created_on desc")
|
||||
@reply_count = @replies.count
|
||||
|
|
|
@ -1053,6 +1053,11 @@ module ApplicationHelper
|
|||
:user_id => User.current,
|
||||
:contest_id => forge_message_id,
|
||||
:viewed => false)
|
||||
elsif(message_type == "BlogMessage")
|
||||
query = BlogMessage.where(:blog_message_type => "BlogComment",
|
||||
:user_id => User.current,
|
||||
:blog_id => forge_message_id,
|
||||
:viewed => false)
|
||||
end
|
||||
query.update_all(:viewed => true) unless query.blank?
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue