@@ -135,8 +135,15 namespace :redmine do | |||
|
135 | 135 | File.file? trac_fullpath |
|
136 | 136 | end |
|
137 | 137 | |
|
138 |
def |
|
|
139 |
File.open("#{trac_fullpath}", 'rb') |
|
|
138 | def open | |
|
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 | 147 | end |
|
141 | 148 | |
|
142 | 149 | def description |
@@ -506,12 +513,14 namespace :redmine do | |||
|
506 | 513 | # Attachments |
|
507 | 514 | ticket.attachments.each do |attachment| |
|
508 | 515 | next unless attachment.exist? |
|
509 | a = Attachment.new :created_on => attachment.time | |
|
510 | a.file = attachment | |
|
511 | a.author = find_or_create_user(attachment.author) | |
|
512 | a.container = i | |
|
513 | a.description = attachment.description | |
|
514 | migrated_ticket_attachments += 1 if a.save | |
|
516 | attachment.open { | |
|
517 | a = Attachment.new :created_on => attachment.time | |
|
518 | a.file = attachment | |
|
519 | a.author = find_or_create_user(attachment.author) | |
|
520 | a.container = i | |
|
521 | a.description = attachment.description | |
|
522 | migrated_ticket_attachments += 1 if a.save | |
|
523 | } | |
|
515 | 524 | end |
|
516 | 525 | |
|
517 | 526 | # Custom fields |
General Comments 0
You need to be logged in to leave comments.
Login now