From 2156b6db76fd977fcf48540fe015867158bbbe49 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 22 Feb 2016 16:56:37 +0800 Subject: [PATCH] =?UTF-8?q?issue=E5=9B=9E=E5=A4=8D=20Forge=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=9B=B4=E6=96=B0=E6=8E=92=E5=BA=8F=E9=9D=A0=E5=89=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/journal.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/models/journal.rb b/app/models/journal.rb index 2da815a44..b184c82e6 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -52,6 +52,7 @@ class Journal < ActiveRecord::Base # fq after_save :act_as_activity,:be_user_score, :act_as_forge_message, :act_as_at_message + after_create :update_issue_time # end #after_destroy :down_user_score #before_save :be_user_score @@ -230,4 +231,12 @@ class Journal < ActiveRecord::Base project.project_score.update_attribute(:issue_journal_num, project.project_score.issue_journal_num + 1) end end + + # 回复issue的时候,更新issue的时候 + def update_issue_time + if self.journalized_type == "Issue" + forge_activity = ForgeActivity.where("forge_act_id =? and forge_act_type =?", self.issue, "Issue").first + forge_activity.update_attribute(:created_at, self.created_on) unless forge_activity.nil? + end + end end