项目缺陷的属性变化时更新动态表中相应缺陷的最后更新时间

This commit is contained in:
cxt 2015-09-17 17:26:48 +08:00
parent a99d56b2e6
commit 7254cf4689
1 changed files with 7 additions and 0 deletions

View File

@ -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