From 679ad8406d4f467d0376e0b25890a017b4759c83 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Sat, 18 Jul 2015 17:01:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/activities_helper.rb | 2 +- app/models/activity.rb | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/helpers/activities_helper.rb b/app/helpers/activities_helper.rb index 822613455..c8cb20ba9 100644 --- a/app/helpers/activities_helper.rb +++ b/app/helpers/activities_helper.rb @@ -57,7 +57,7 @@ module ActivitiesHelper end #留言 if activity.act_type == 'JournalsForMessage' - return [activity.act.jour_type,activity.act.jour_id] + return [activity.act.jour_type,activity.act.jour_id,activity.act.user_id] end # HomeworkCommon Issue Journal Message News diff --git a/app/models/activity.rb b/app/models/activity.rb index 679cb9599..63081be6f 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -14,8 +14,11 @@ class Activity < ActiveRecord::Base #helper :activities include ActivitiesHelper def set_container_type_val - container_type,container_id =get_container_type(self) - self.activity_container_type = container_type - self.activity_container_id = container_id + params =get_container_type(self) + self.activity_container_type = params[0] + self.activity_container_id = params[1] + if(self.act_type == 'JournalsForMessage') + self.user_id = params[2] + end end end