From 6f773b902b138f0aa235194cfd4921d815ee5349 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 21 Jul 2015 11:59:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E7=89=88=E6=9C=AC?= =?UTF-8?q?=20=E7=AE=A1=E7=90=86=20=E5=8F=AF=E4=BB=A5=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3e3718f7e..165e22071 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1824,7 +1824,9 @@ module ApplicationHelper def attachment_candown attachment candown = false if attachment.container - if attachment.container.class.to_s != "HomeworkAttach" && attachment.container.class.to_s != "StudentWork" && (attachment.container.has_attribute?(:project) || attachment.container.has_attribute?(:project_id)) && attachment.container.project + if attachment.container.class.to_s=="PhoneAppVersion" + candown = true + elsif attachment.container.class.to_s != "HomeworkAttach" && attachment.container.class.to_s != "StudentWork" && (attachment.container.has_attribute?(:project) || attachment.container.has_attribute?(:project_id)) && attachment.container.project project = attachment.container.project candown= User.current.member_of?(project) || (project.is_public && attachment.is_public == 1) elsif attachment.container.is_a?(Project) @@ -1850,8 +1852,7 @@ module ApplicationHelper candown = true elsif attachment.container.class.to_s=="StudentWork" candown = true - elsif attachment.container.class.to_s=="PhoneAppVersion" - candown = true + elsif attachment.container_type == "Bid" && attachment.container && attachment.container.courses course = attachment.container.courses.first candown = User.current.member_of_course?(attachment.container.courses.first) || (course.is_public == 1 && attachment.is_public == 1)