From 6893b3dcab18b532286859c5416befdc5ae6dc6e Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 2 Mar 2016 14:56:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E9=A1=B5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/users_helper.rb | 40 +++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 1e924cefa..b77dfe3bd 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -57,25 +57,27 @@ module UsersHelper def get_resource_origin attach type = attach.container_type content = attach.container - case type - when 'Course' - result = current_time_and_term_resource content - when 'Project' - result = content.name - when 'Issue' - result = content.subject - when 'Message' - result = content.subject - when 'News' - result = content.title - when 'HomewCommon' - result = content.name - when 'StudentWorkScore' - result = content.name - when 'Principal' - result = content.name - when 'OrgSubfield' - result = content.name + unless content.nil? + case type + when 'Course' + result = current_time_and_term_resource content + when 'Project' + result = content.name + when 'Issue' + result = content.subject + when 'Message' + result = content.subject + when 'News' + result = content.title + when 'HomewCommon' + result = content.name + when 'StudentWorkScore' + result = content.name + when 'Principal' + result = content.name + when 'OrgSubfield' + result = content.name + end end end