|
|
|
@ -192,7 +192,6 @@ class InitializationDataController < ApplicationController
|
|
|
|
|
Shixun.bulk_insert(*shixun_attrs) do |worker|
|
|
|
|
|
@shixuns.each do |shixun|
|
|
|
|
|
base_attr = shixun.attributes.dup.except("user_id", "myshixuns_count", "use_scope")
|
|
|
|
|
logger.info("#######shixun:#{base_attr}")
|
|
|
|
|
worker.add(base_attr.merge(user_id: 1))
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -401,10 +400,11 @@ class InitializationDataController < ApplicationController
|
|
|
|
|
downloads description disk_directory attachtype is_public copy_from quotes is_publish publish_time resource_bank_id unified_setting
|
|
|
|
|
cloud_url course_second_category_id]
|
|
|
|
|
Attachment.bulk_insert(*attachment_attrs) do |worker|
|
|
|
|
|
Attachment.where(id: @att_ids).find_each do |att|
|
|
|
|
|
base_attr = att.attributes.except("author_id", "disk_directory", "copy_from")
|
|
|
|
|
Attachment.where(id: @att_ids).each do |att|
|
|
|
|
|
logger.info("########att_id: #{att.id}")
|
|
|
|
|
base_attr = att.attributes.dup.except("author_id", "disk_directory", "copy_from")
|
|
|
|
|
# 本地版将过关任务的图片迁移到files/localshixuns 目录下, copy_from记录的是他原来的目录结构
|
|
|
|
|
worker.add(base_attr.merge({author_id: 1, disk_directory: "localshixuns", copy_from: att.disk_directory}))
|
|
|
|
|
worker.add(base_attr.merge(author_id: 1, disk_directory: "localshixuns", copy_from: att.disk_directory))
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|