diff --git a/app/models/course.rb b/app/models/course.rb index 24e955d15..0194a2a9d 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -1,7 +1,6 @@ require 'elasticsearch/model' class Course < ActiveRecord::Base include Redmine::SafeAttributes - include ApplicationHelper STATUS_ACTIVE = 1 STATUS_CLOSED = 5 @@ -71,7 +70,7 @@ class Course < ActiveRecord::Base validates_length_of :description, :maximum => 10000 before_save :self_validate # 公开课程变成私有课程,所有资源都变成私有 - after_update :update_files_public,:update_course_ealasticsearch_index,:update_activity + after_update :update_files_public,:update_course_ealasticsearch_index after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index before_destroy :delete_all_members,:delete_course_ealasticsearch_index @@ -429,12 +428,6 @@ class Course < ActiveRecord::Base end end end -#动态的更新 -def update_activity - update_course_activity(self.class, self.id) - update_user_activity(self.class, self.id) - update_org_activity(self.class, self.id) -end # Delete the previous articles index in Elasticsearch # Course.__elasticsearch__.client.indices.delete index: Course.index_name rescue nil diff --git a/app/views/organizations/_org_course_create.html.erb b/app/views/organizations/_org_course_create.html.erb index a5544ab07..dc1e0ee81 100644 --- a/app/views/organizations/_org_course_create.html.erb +++ b/app/views/organizations/_org_course_create.html.erb @@ -17,13 +17,9 @@
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
-
+
创建时间:<%= format_time(activity.created_at) %>
-
- 更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> -
-