From 87e658a0f1367a73afaf5f2e1abd243054a3b0ac Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 3 Feb 2015 15:46:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=84=E8=AE=BA=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E5=8C=BF=E8=AF=84=E7=BB=93=E6=9D=9F=E5=90=8E?= =?UTF-8?q?=E4=BE=9D=E7=84=B6=E5=8F=AF=E4=BB=A5=E8=AF=84=E8=AE=BA=EF=BC=88?= =?UTF-8?q?=E5=B1=9E=E4=BA=8E=E7=95=99=E8=A8=80=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/homework_service.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/services/homework_service.rb b/app/services/homework_service.rb index abf89229c..b468e1110 100644 --- a/app/services/homework_service.rb +++ b/app/services/homework_service.rb @@ -146,13 +146,8 @@ class HomeworkService @cur_page,@cur_type = params[:cur_page] || 1,params[:cur_type] || 5 @homework = HomeworkAttach.find(params[:homework_id]) comment_status = @homework.bid.comment_status - if @is_anonymous_comments && comment_status != 1 - case comment_status - when 0 - raise '尚未开启匿评!' - when 2 - raise '匿评已结束!' - end + if @is_anonymous_comments && comment_status == 0 + raise '尚未开启匿评!' end if @is_anonymous_comments && ((@m_score.nil? || @m_score.blank?) || !(params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "")) raise '您尚未打分或评论!'