diff --git a/app/models/course_activity.rb b/app/models/course_activity.rb index c9c6cec4b..9c1431d5d 100644 --- a/app/models/course_activity.rb +++ b/app/models/course_activity.rb @@ -67,8 +67,9 @@ class CourseActivity < ActiveRecord::Base # 导语 def add_course_lead if self.course_act_type == "Course" - name = Redmine::Configuration['course_message_lead_subject'] - content = Redmine::Configuration['course_message_lead_content'] + lead_message = Message.find(12440) + name = lead_message.subject + content = lead_message.content # message的status状态为0为正常,为1表示创建课程时发送的message message = Message.create(:subject => name, :content => content, :board_id => self.course.boards.first.id, :author_id => self.course.tea_id , :sticky => true, :status => true ) # 更新的目的是为了排序,因为该条动态的时间可能与课程创建的动态创建时间一直