diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-05-29 19:31:21 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-05-29 19:31:21 +0000 |
commit | ffea0446992f91ae45ff3c9d47a89d24d23298a1 (patch) | |
tree | 23824c624498c699e5338c64f13f961d5b63068c /lib/tasks | |
parent | 6ebdf848a583add999e9f27a5d1a0bf4009d478d (diff) | |
download | redmine-ffea0446992f91ae45ff3c9d47a89d24d23298a1.tar.gz redmine-ffea0446992f91ae45ff3c9d47a89d24d23298a1.zip |
Trac importer: migrate attachments descriptions (#1326).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1477 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/migrate_from_trac.rake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/tasks/migrate_from_trac.rake b/lib/tasks/migrate_from_trac.rake index 48a774eef..5341fa14a 100644 --- a/lib/tasks/migrate_from_trac.rake +++ b/lib/tasks/migrate_from_trac.rake @@ -126,6 +126,10 @@ namespace :redmine do File.open("#{trac_fullpath}", 'rb').read end + def description + read_attribute(:description).to_s.slice(0,255) + end + private def trac_fullpath attachment_type = read_attribute(:type) @@ -408,6 +412,7 @@ namespace :redmine do a.file = attachment a.author = find_or_create_user(attachment.author) a.container = i + a.description = attachment.description migrated_ticket_attachments += 1 if a.save end @@ -456,6 +461,7 @@ namespace :redmine do 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 |