|
|
@ -106,7 +106,7 @@ class GraduationTopicsController < ApplicationController
|
|
|
|
def student_select_topic
|
|
|
|
def student_select_topic
|
|
|
|
if User.current.student_graduation_topics.where(:course_id => @course.id, :status => [0, 1]).count == 0
|
|
|
|
if User.current.student_graduation_topics.where(:course_id => @course.id, :status => [0, 1]).count == 0
|
|
|
|
@topic.student_graduation_topics << StudentGraduationTopic.new(:course_id => @course.id, :user_id => User.current.id,
|
|
|
|
@topic.student_graduation_topics << StudentGraduationTopic.new(:course_id => @course.id, :user_id => User.current.id,
|
|
|
|
:member_id => @course.members.where(:user_id => User.current.id).first.try(:id))
|
|
|
|
:member_id => @course.course_members.where(:user_id => current_user.id).first.try(:id))
|
|
|
|
@topic.update_attributes(:status => 1)
|
|
|
|
@topic.update_attributes(:status => 1)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
redirect_to graduation_topic_path(@topic)
|
|
|
|
redirect_to graduation_topic_path(@topic)
|
|
|
|