Fixed Trac importer broken by r2670 (#3254).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2705 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
fa7bd1c71d
commit
ad1ffa06a0
|
@ -135,8 +135,15 @@ namespace :redmine do
|
||||||
File.file? trac_fullpath
|
File.file? trac_fullpath
|
||||||
end
|
end
|
||||||
|
|
||||||
def read
|
def open
|
||||||
File.open("#{trac_fullpath}", 'rb').read
|
File.open("#{trac_fullpath}", 'rb') {|f|
|
||||||
|
@file = f
|
||||||
|
yield self
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
def read(*args)
|
||||||
|
@file.read(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
def description
|
def description
|
||||||
|
@ -506,12 +513,14 @@ namespace :redmine do
|
||||||
# Attachments
|
# Attachments
|
||||||
ticket.attachments.each do |attachment|
|
ticket.attachments.each do |attachment|
|
||||||
next unless attachment.exist?
|
next unless attachment.exist?
|
||||||
a = Attachment.new :created_on => attachment.time
|
attachment.open {
|
||||||
a.file = attachment
|
a = Attachment.new :created_on => attachment.time
|
||||||
a.author = find_or_create_user(attachment.author)
|
a.file = attachment
|
||||||
a.container = i
|
a.author = find_or_create_user(attachment.author)
|
||||||
a.description = attachment.description
|
a.container = i
|
||||||
migrated_ticket_attachments += 1 if a.save
|
a.description = attachment.description
|
||||||
|
migrated_ticket_attachments += 1 if a.save
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
# Custom fields
|
# Custom fields
|
||||||
|
|
Loading…
Reference in New Issue