From 5e91a258fedeaa415e8258a562a3c6b77460698f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 5 Nov 2014 10:54:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=B2=E7=BB=8F=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E8=BF=87=E4=BD=9C=E4=B8=9A=E3=80=81=E5=86=8D=E6=AC=A1?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=8A=A5403?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 4b7fdb15e..42c7ffc77 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -227,7 +227,7 @@ class HomeworkAttachController < ApplicationController def create bid = Bid.find params[:bid_id] if User.current.admin? || User.current.member_of_course?(bid.courses.first) # modify by nwb - if bid.homeworks.where("user_id = ?",User.current).count == 0 + if bid.homeworks.where("user_id = ?",User.current).empty? user_id = params[:user_id] bid_id = params[:bid_id] if params[:homework_attach]