From 298b767fc4676674920eef5f4de656fe127264b7 Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 1 Dec 2014 15:03:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=98=BE=E7=A4=BA=EF=BC=8C?= =?UTF-8?q?=E5=AF=B9=E4=BA=8E=E8=AF=BE=E7=A8=8B=E5=A4=96=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E4=B8=8D=E5=9C=A8=E6=98=BE=E7=A4=BA=E7=A7=81=E6=9C=89=E8=B5=84?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/files_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index c9a232c36..e1aebefdc 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -86,7 +86,7 @@ module FilesHelper def visable_attachemnts attachments result = [] attachments.each do |attachment| - if attachment.is_public? || (attachment.container_type == "Course" && attachment.author.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id + if attachment.is_public? || (attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id result << attachment end end @@ -106,7 +106,7 @@ module FilesHelper def visable_attachemnts_insite attachments,course result = [] attachments.each do |attachment| - if attachment.is_public? || (attachment.container_type == "Course" && attachment.container_id == course.id && attachment.author.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id + if attachment.is_public? || (attachment.container_type == "Course" && attachment.container_id == course.id && User.current.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id result << attachment end end