Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_forum
cxt 5 years ago
commit fe27f7de3d

@ -193,8 +193,8 @@ class GraduationTopicsController < ApplicationController
def student_select_topic def student_select_topic
user_unaccept_topics = @course.student_graduation_topics.where(user_id: current_user.id, status: [0, 1]) user_unaccept_topics = @course.student_graduation_topics.where(user_id: current_user.id, status: [0, 1])
if user_unaccept_topics.size == 0 if user_unaccept_topics.size == 0
member_id = @course.course_members.find_by_user_id(current_user.id) member = @course.course_members.find_by_user_id(current_user.id)
StudentGraduationTopic.create(course_id: @course.id, user_id: current_user.id, course_member_id: member_id, StudentGraduationTopic.create(course_id: @course.id, user_id: current_user.id, course_member_id: member.try(:id),
graduation_topic_id: @graduation_topic.id) graduation_topic_id: @graduation_topic.id)
@graduation_topic.update_attribute(:status, 1) @graduation_topic.update_attribute(:status, 1)
normal_status("选题成功") normal_status("选题成功")

Loading…
Cancel
Save