Revision 1477
Added by Jean-Philippe Lang about 17 years ago
trunk/lib/tasks/migrate_from_trac.rake | ||
---|---|---|
126 | 126 |
File.open("#{trac_fullpath}", 'rb').read |
127 | 127 |
end |
128 | 128 |
|
129 |
def description |
|
130 |
read_attribute(:description).to_s.slice(0,255) |
|
131 |
end |
|
132 |
|
|
129 | 133 |
private |
130 | 134 |
def trac_fullpath |
131 | 135 |
attachment_type = read_attribute(:type) |
... | ... | |
408 | 412 |
a.file = attachment |
409 | 413 |
a.author = find_or_create_user(attachment.author) |
410 | 414 |
a.container = i |
415 |
a.description = attachment.description |
|
411 | 416 |
migrated_ticket_attachments += 1 if a.save |
412 | 417 |
end |
413 | 418 |
|
... | ... | |
456 | 461 |
a = Attachment.new :created_on => attachment.time |
457 | 462 |
a.file = attachment |
458 | 463 |
a.author = find_or_create_user(attachment.author) |
464 |
a.description = attachment.description |
|
459 | 465 |
a.container = p |
460 | 466 |
migrated_wiki_attachments += 1 if a.save |
461 | 467 |
end |
Also available in: Unified diff
Trac importer: migrate attachments descriptions (#1326).