更改:禅道导入数据脚本
This commit is contained in:
parent
1d9387e1ab
commit
118edbf61f
|
@ -9,7 +9,7 @@ namespace :import_from_chandao do
|
||||||
CSV.foreach("#{Rails.root}/#{args.name}", headers: true) do | row |
|
CSV.foreach("#{Rails.root}/#{args.name}", headers: true) do | row |
|
||||||
randd_field_hash = row.to_hash
|
randd_field_hash = row.to_hash
|
||||||
issue = Issue.new(issue_classify: "issue")
|
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
|
issue.author_id = author&.id
|
||||||
assigner = randd_field_hash['指派给'].present? ? User.like(randd_field_hash['指派给']).take : nil
|
assigner = randd_field_hash['指派给'].present? ? User.like(randd_field_hash['指派给']).take : nil
|
||||||
if assigner.present?
|
if assigner.present?
|
||||||
|
|
Loading…
Reference in New Issue