15 lines
292 B
Ruby
15 lines
292 B
Ruby
|
namespace :import do
|
||
|
desc "fix import name"
|
||
|
task :fix => :environment do
|
||
|
HomeworkCommon.find_each do |homework|
|
||
|
name = homework.name.sub("\n", " ").sub("\r\n", " ")
|
||
|
if name != homework.name
|
||
|
homework.name = name
|
||
|
homework.save!
|
||
|
end
|
||
|
|
||
|
end
|
||
|
end
|
||
|
|
||
|
end
|