From 27d7200224e5f1619bcb7ac863f0375fd45ecc7d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 5 Aug 2019 15:44:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 7566bf672..7bb36a8a0 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -155,7 +155,7 @@ class MemosController < ApplicationController @reply.root_id = memo.root_id || memo.id memo.children << @reply m = Memo.find_by!(id: @reply.root_id) - m.increment!(:all_replies_count, 1, true) + m.update_attributes!(all_replies_count: m.all_replies_count + 1) rescue Exception => e tip_exception("回复失败,原因:#{e}") raise ActiveRecord::Rollback