From 7713fba2f8627edb00d1f5e09a55c0936fb4347b Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Thu, 24 Nov 2016 14:30:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E7=95=99=E8=A8=80=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 7 ++++--- app/models/journals_for_message.rb | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 56b536d30..049789115 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1369,9 +1369,10 @@ class UsersController < ApplicationController @jour = jours.limit(10).offset(@page * 10) @type = params[:type] if User.current == @user - jours.update_all(:is_readed => true, :status => false) - jours.each do |journal| - fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false) + @jour.update_all(:is_readed => true, :status => false) + @jour.each do |journal| + # fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false) + journal.delay.set_children_readed_delay end end @state = false diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index 4a9601d07..aa83c2210 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -344,4 +344,9 @@ class JournalsForMessage < ActiveRecord::Base def content_detail self.notes end + + def set_children_readed_delay + # fetch_user_leaveWord_reply(self).update_all(:is_readed => true, :status => false) + end + end