From 902cfdcbe9e4b37d26ee1e0ce6f831124e2c162a Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 15 Jan 2016 10:29:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B/=E9=A1=B9=E7=9B=AE=E7=9A=84?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=8A=A8=E6=80=81=E4=B8=8D=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 9 +-------- app/views/organizations/_org_course_create.html.erb | 6 +----- app/views/organizations/_project_create.html.erb | 6 +----- app/views/projects/_project_create.html.erb | 6 +----- app/views/users/_course_create.html.erb | 6 +----- app/views/users/_project_create.html.erb | 6 +----- 6 files changed, 6 insertions(+), 33 deletions(-) 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) %> -
-