##// END OF EJS Templates
Trac importer: migrate attachments descriptions (#1326)....
Jean-Philippe Lang -
r1463:ffea0446992f
parent child
Show More
@@ -126,6 +126,10 namespace :redmine do
126 File.open("#{trac_fullpath}", 'rb').read
126 File.open("#{trac_fullpath}", 'rb').read
127 end
127 end
128
128
129 def description
130 read_attribute(:description).to_s.slice(0,255)
131 end
132
129 private
133 private
130 def trac_fullpath
134 def trac_fullpath
131 attachment_type = read_attribute(:type)
135 attachment_type = read_attribute(:type)
@@ -408,6 +412,7 namespace :redmine do
408 a.file = attachment
412 a.file = attachment
409 a.author = find_or_create_user(attachment.author)
413 a.author = find_or_create_user(attachment.author)
410 a.container = i
414 a.container = i
415 a.description = attachment.description
411 migrated_ticket_attachments += 1 if a.save
416 migrated_ticket_attachments += 1 if a.save
412 end
417 end
413
418
@@ -456,6 +461,7 namespace :redmine do
456 a = Attachment.new :created_on => attachment.time
461 a = Attachment.new :created_on => attachment.time
457 a.file = attachment
462 a.file = attachment
458 a.author = find_or_create_user(attachment.author)
463 a.author = find_or_create_user(attachment.author)
464 a.description = attachment.description
459 a.container = p
465 a.container = p
460 migrated_wiki_attachments += 1 if a.save
466 migrated_wiki_attachments += 1 if a.save
461 end
467 end
General Comments 0
You need to be logged in to leave comments. Login now