Defect #3291 ยป migrate_from_trac.rake.patch
lib/tasks/migrate_from_trac.rake (working copy) | ||
---|---|---|
565 | 565 |
page.attachments.each do |attachment| |
566 | 566 |
next unless attachment.exist? |
567 | 567 |
next if p.attachments.find_by_filename(attachment.filename.gsub(/^.*(\\|\/)/, '').gsub(/[^\w\.\-]/,'_')) #add only once per page |
568 |
a = Attachment.new :created_on => attachment.time |
|
569 |
a.file = attachment |
|
570 |
a.author = find_or_create_user(attachment.author) |
|
571 |
a.description = attachment.description |
|
572 |
a.container = p |
|
573 |
migrated_wiki_attachments += 1 if a.save |
|
568 |
attachment.open { |
|
569 |
a = Attachment.new :created_on => attachment.time |
|
570 |
a.file = attachment |
|
571 |
a.author = find_or_create_user(attachment.author) |
|
572 |
a.description = attachment.description |
|
573 |
a.container = p |
|
574 |
migrated_wiki_attachments += 1 if a.save |
|
575 |
} |
|
574 | 576 |
end |
575 | 577 |
end |
576 | 578 |