From a1553c7a8fb052658fbc4c8dcb9dfd68366b4947 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 29 Jul 2016 16:27:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/members_controller.rb | 4 ++-- app/views/courses/_course_members.html.erb | 13 ------------- app/views/courses/_member.html.erb | 13 ------------- 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 9c6f606f6..fe0da8d78 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -158,7 +158,7 @@ class MembersController < ApplicationController role_ids = attrs.delete(:role_ids) #role = Role.find(params[:membership][:role_ids]) # 这里的判断只能通过角色名,可以弄成常量 - if role_ids && !role_ids.include?("9") && role_ids.include?("10") + if role_ids && role_ids.include?("10") StudentsForCourse.create(:student_id => user_id, :course_id =>@course.id) end @@ -257,7 +257,7 @@ class MembersController < ApplicationController attrs = params[:membership].dup role_ids = attrs.delete(:role_ids) - if role_ids && !role_ids.include?("9") && role_ids.include?("10") + if role_ids && role_ids.include?("10") StudentsForCourse.create(:student_id => @member.user_id, :course_id =>@course.id) else joined = StudentsForCourse.where('student_id = ? and course_id = ?', @member.user_id,@course.id) diff --git a/app/views/courses/_course_members.html.erb b/app/views/courses/_course_members.html.erb index 563cbfff3..90db21489 100644 --- a/app/views/courses/_course_members.html.erb +++ b/app/views/courses/_course_members.html.erb @@ -52,7 +52,6 @@ \ No newline at end of file diff --git a/app/views/courses/_member.html.erb b/app/views/courses/_member.html.erb index 35cf0438c..9e6abcf4f 100644 --- a/app/views/courses/_member.html.erb +++ b/app/views/courses/_member.html.erb @@ -39,7 +39,6 @@ <% end%>