diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-05-10 08:39:23 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-05-10 08:39:23 +0000 |
commit | 7e1ac0e602a8eb39b08543b8fb190d3456bb264c (patch) | |
tree | cbc38fdae0f6f1ba4ace605d3485399611bce540 /lib | |
parent | 3704653c7acaebca6dabe2d8d85f621d4fcebb48 (diff) | |
download | redmine-7e1ac0e602a8eb39b08543b8fb190d3456bb264c.tar.gz redmine-7e1ac0e602a8eb39b08543b8fb190d3456bb264c.zip |
Same as fix as r2705 from Trac wiki pages attachments (#3291).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2718 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/migrate_from_trac.rake | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/tasks/migrate_from_trac.rake b/lib/tasks/migrate_from_trac.rake index 7ee5c4ece..77d16b7dd 100644 --- a/lib/tasks/migrate_from_trac.rake +++ b/lib/tasks/migrate_from_trac.rake @@ -565,12 +565,14 @@ namespace :redmine do page.attachments.each do |attachment| next unless attachment.exist? next if p.attachments.find_by_filename(attachment.filename.gsub(/^.*(\\|\/)/, '').gsub(/[^\w\.\-]/,'_')) #add only once per page - a = Attachment.new :created_on => attachment.time - a.file = attachment - a.author = find_or_create_user(attachment.author) - a.description = attachment.description - a.container = p - migrated_wiki_attachments += 1 if a.save + attachment.open { + a = Attachment.new :created_on => attachment.time + a.file = attachment + a.author = find_or_create_user(attachment.author) + a.description = attachment.description + a.container = p + migrated_wiki_attachments += 1 if a.save + } end end |