课程导语从帖子中获取
This commit is contained in:
parent
efff99c05b
commit
1234bc0aef
|
@ -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 )
|
||||
# 更新的目的是为了排序,因为该条动态的时间可能与课程创建的动态创建时间一直
|
||||
|
|
Loading…
Reference in New Issue