socialforge/lib/tasks/import_fix.rake

15 lines
292 B
Ruby
Raw Normal View History

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