2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-07-06 13:11:32 -04:00
|
|
|
module Jobs
|
|
|
|
|
2019-10-02 00:01:53 -04:00
|
|
|
class MigrateUploadExtensions < ::Jobs::Onceoff
|
2017-07-06 13:11:32 -04:00
|
|
|
def execute_onceoff(args)
|
|
|
|
Upload.find_each do |upload|
|
|
|
|
upload.extension = File.extname(upload.original_filename)[1..10]
|
|
|
|
upload.save
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|