##// END OF EJS Templates
Fixed Trac importer broken by r2670 (#3254)....
Jean-Philippe Lang -
r2609:ad1ffa06a070
parent child
Show More
@@ -135,8 +135,15 namespace :redmine do
135 File.file? trac_fullpath
135 File.file? trac_fullpath
136 end
136 end
137
137
138 def read
138 def open
139 File.open("#{trac_fullpath}", 'rb').read
139 File.open("#{trac_fullpath}", 'rb') {|f|
140 @file = f
141 yield self
142 }
143 end
144
145 def read(*args)
146 @file.read(*args)
140 end
147 end
141
148
142 def description
149 def description
@@ -506,12 +513,14 namespace :redmine do
506 # Attachments
513 # Attachments
507 ticket.attachments.each do |attachment|
514 ticket.attachments.each do |attachment|
508 next unless attachment.exist?
515 next unless attachment.exist?
516 attachment.open {
509 a = Attachment.new :created_on => attachment.time
517 a = Attachment.new :created_on => attachment.time
510 a.file = attachment
518 a.file = attachment
511 a.author = find_or_create_user(attachment.author)
519 a.author = find_or_create_user(attachment.author)
512 a.container = i
520 a.container = i
513 a.description = attachment.description
521 a.description = attachment.description
514 migrated_ticket_attachments += 1 if a.save
522 migrated_ticket_attachments += 1 if a.save
523 }
515 end
524 end
516
525
517 # Custom fields
526 # Custom fields
General Comments 0
You need to be logged in to leave comments. Login now