From 837fbe74e83f96cba9698caf8e1bed98484c75ac Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 29 May 2015 09:38:59 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E8=80=81=E5=B8=88=E5=92=8C=E5=90=8C?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=9A=84=E5=AD=A6=E7=94=9F=E6=9C=89=E6=9D=83?= =?UTF-8?q?=E9=99=90=E4=B8=8B=E5=91=A8=E4=BD=9C=E5=93=81=E9=99=84=E4=BB=B6?= =?UTF-8?q?=202=E3=80=81=E4=BD=9C=E5=93=81=E9=99=84=E4=BB=B6=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=88=90=E5=8A=9F=E4=B9=8B=E5=90=8E=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 2 +- app/helpers/application_helper.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 076082d93..532fbb51e 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -428,7 +428,7 @@ private @attachment.container.board.course) @course = @attachment.container.board.course else - unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' || @attachment.container_type == 'PhoneAppVersion' || @attachment.container_type = 'StudentWorksScore' + unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' || @attachment.container_type == 'PhoneAppVersion' || @attachment.container_type == 'StudentWorksScore'|| @attachment.container_type == 'StudentWorks' @project = @attachment.project end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 446ad994b..268781df3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1844,7 +1844,11 @@ module ApplicationHelper attachment.container.board.course course = attachment.container.board.course candown= User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1) - elsif attachment.container.class.to_s=="HomeworkAttach" && attachment.container.bid.reward_type == 3 + elsif attachment.container.class.to_s=="HomeworkAttach" + candown = true + elsif attachment.container.class.to_s=="StudentWorksScore" + candown = true + elsif attachment.container.class.to_s=="StudentWork" candown = true elsif attachment.container_type == "Bid" && attachment.container && attachment.container.courses course = attachment.container.courses.first