From 6530c657eece0f5e556823b98e179abf3db02e21 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 21 Oct 2014 08:55:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8Ballow=5Fjoin=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=A2=9E=E5=8A=A0=E8=AF=BE=E7=A8=8B=E7=9A=84=E4=BC=A0?= =?UTF-8?q?=E5=85=A5=EF=BC=8C=E5=87=8F=E5=B0=91=E8=AF=BE=E7=A8=8B=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 6507b3178..f91ccf550 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -29,7 +29,7 @@ class CoursesController < ApplicationController if course @state = 4 else - unless (allow_join && User.current.member_of_course?(course)) + unless (allow_join(course) && User.current.member_of_course?(course)) if params[:course_password] == course.password members = [] members << Member.new(:role_ids => [10], :user_id => User.current.id) @@ -700,8 +700,8 @@ class CoursesController < ApplicationController private - def allow_join - if course_endTime_timeout? Course.find(params[:object_id]) + def allow_join course + if course_endTime_timeout? course respond_to do |format| format.js { @state = 2