更改:禅道导入数据脚本

This commit is contained in:
yystopf 2024-08-22 14:53:00 +08:00
parent 1d9387e1ab
commit 118edbf61f
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ namespace :import_from_chandao do
CSV.foreach("#{Rails.root}/#{args.name}", headers: true) do | row |
randd_field_hash = row.to_hash
issue = Issue.new(issue_classify: "issue")
author = User.like(randd_field_hash['由谁创建']).take
author = User.like(randd_field_hash['由谁创建']).take || User.where(admin: first).first
issue.author_id = author&.id
assigner = randd_field_hash['指派给'].present? ? User.like(randd_field_hash['指派给']).take : nil
if assigner.present?