From 363e6812549a815f2f2da19317febd6a8dd8156a Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 12 Dec 2014 16:52:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=BE=E7=A8=8B=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=87=BA=E9=94=99=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 34dfca75f..952dcdf44 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -87,8 +87,9 @@ class AttachmentsController < ApplicationController 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 candown = true - elsif @attachment.container_type == "Bid" && @attachment.container && @attachment.container.courses - candown = User.current.member_of_course?(@attachment.container.courses.first) || (course.is_public == 1 && @attachment.is_public == 1) + elsif @attachment.container_type == "Bid" && @attachment.container && @attachment.container.courses.first + course = @attachment.container.courses.first + candown = User.current.member_of_course?(course) || (course.is_public == 1 && @attachment.is_public == 1) else candown = @attachment.is_public == 1