From 6451e82e532b8e2c2581d04c50d9db41f483e114 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 16 Aug 2019 11:18:17 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index bcfed25dd..e0ad6c5e5 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -221,8 +221,10 @@ class FilesController < ApplicationController @new_attachment_history = @old_attachment.become_history @new_attachment_history.save! + old_course_second_category_id = @old_attachment.course_second_category_id @old_attachment.copy_attributes_from_new_attachment(@new_attachment) @old_attachment.is_public = is_public == true ? 1 : 0 if is_public + @old_attachment.course_second_category_id = old_course_second_category_id @old_attachment.save! @new_attachment.delete end From 33cc18117f38981ce9913e7aa110abbd9dbd88a1 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 16 Aug 2019 11:18:53 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/public_course.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/public_course.rake b/lib/tasks/public_course.rake index 7ed492968..d2777e613 100644 --- a/lib/tasks/public_course.rake +++ b/lib/tasks/public_course.rake @@ -102,7 +102,7 @@ namespace :public_course do course.attachments.each do |atta| created_on = random_time start_time, end_time - atta.update_columns(is_publish: 1, created_on: created_on) + atta.update_columns(is_publish: 1, created_on: created_on, publish_time: created_on) end end From b377047dfd9fddc5056db752de55ea4f59c42308 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 16 Aug 2019 11:29:46 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index e0ad6c5e5..2bdd88566 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -210,6 +210,7 @@ class FilesController < ApplicationController is_unified_setting = params[:is_unified_setting] publish_time = params[:publish_time] + publish_time = format_time(Time.parse(publish_time)) unless publish_time.blank? is_public = params[:is_public] course_group_publish_times = params[:course_group_publish_times] || []