@@ -118,10 +118,6 task :migrate_from_mantis => :environment do | |||||
118 | read_attribute(:name)[0..29] |
|
118 | read_attribute(:name)[0..29] | |
119 | end |
|
119 | end | |
120 |
|
120 | |||
121 | def description |
|
|||
122 | read_attribute(:description).blank? ? read_attribute(:name) : read_attribute(:description)[0..254] |
|
|||
123 | end |
|
|||
124 |
|
||||
125 | def identifier |
|
121 | def identifier | |
126 | read_attribute(:name).underscore[0..19].gsub(/[^a-z0-9\-]/, '-') |
|
122 | read_attribute(:name).underscore[0..19].gsub(/[^a-z0-9\-]/, '-') | |
127 | end |
|
123 | end | |
@@ -186,7 +182,7 task :migrate_from_mantis => :environment do | |||||
186 | end |
|
182 | end | |
187 |
|
183 | |||
188 | def original_filename |
|
184 | def original_filename | |
189 | filename |
|
185 | MantisMigrate.encode(filename) | |
190 | end |
|
186 | end | |
191 |
|
187 | |||
192 | def content_type |
|
188 | def content_type | |
@@ -445,7 +441,6 task :migrate_from_mantis => :environment do | |||||
445 | end |
|
441 | end | |
446 | end |
|
442 | end | |
447 |
|
443 | |||
448 | private |
|
|||
449 | def self.encode(text) |
|
444 | def self.encode(text) | |
450 | @ic.iconv text |
|
445 | @ic.iconv text | |
451 | rescue |
|
446 | rescue |
General Comments 0
You need to be logged in to leave comments.
Login now