Patch #2506 ยป import_trac_no_custom_field_double.diff
| migrate_from_trac.rake (copie de travail) | ||
|---|---|---|
| 518 | 518 |
# Custom fields |
| 519 | 519 |
ticket.customs.each do |custom| |
| 520 | 520 |
next if custom_field_map[custom.name].nil? |
| 521 |
v = CustomValue.new :custom_field => custom_field_map[custom.name], |
|
| 522 |
:value => custom.value |
|
| 521 |
v = CustomValue.find(:first, :conditions => { :customized_type => 'Issue', :customized_id => i.id, :custom_field_id => custom_field_map[custom.name].id })
|
|
| 522 |
v ||= CustomValue.new :custom_field => custom_field_map[custom.name], |
|
| 523 |
:value => custom.value |
|
| 523 | 524 |
v.customized = i |
| 525 |
v.value = custom.value |
|
| 524 | 526 |
next unless v.save |
| 525 | 527 |
migrated_custom_values += 1 |
| 526 | 528 |
end |