From 7254cf4689d52e320d1b3e33af2d9b3b4f6da0a8 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 17 Sep 2015 17:26:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BC=BA=E9=99=B7=E7=9A=84?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=8F=98=E5=8C=96=E6=97=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=A1=A8=E4=B8=AD=E7=9B=B8=E5=BA=94=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=E7=9A=84=E6=9C=80=E5=90=8E=E6=9B=B4=E6=96=B0=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/issue.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/models/issue.rb b/app/models/issue.rb index f7f596e17..2a6da44c5 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -1399,6 +1399,7 @@ class Issue < ActiveRecord::Base def attachment_added(obj) if @current_journal && @current_journal.user_id == obj.author_id && JournalDetail.find_all_by_value(obj.filename).count == 0 @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename) + end end @@ -1407,6 +1408,9 @@ class Issue < ActiveRecord::Base if @current_journal && !obj.new_record? @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :old_value => obj.filename) @current_journal.save + user_activity = UserActivity.where("act_type='Issue' and act_id =#{@current_journal.journalized_id}").first + user_activity.updated_at = Time.now + user_activity.save end end @@ -1513,6 +1517,9 @@ class Issue < ActiveRecord::Base } end @current_journal.save + user_activity = UserActivity.where("act_type='Issue' and act_id =#{@current_journal.journalized_id}").first + user_activity.updated_at = Time.now + user_activity.save # reset current journal init_journal @current_journal.user, @current_journal.notes end