mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 09:41:01 +08:00
12 lines
247 B
Ruby
12 lines
247 B
Ruby
|
module Jobs
|
||
|
|
||
|
class MigrateUploadExtensions < Jobs::Onceoff
|
||
|
def execute_onceoff(args)
|
||
|
Upload.find_each do |upload|
|
||
|
upload.extension = File.extname(upload.original_filename)[1..10]
|
||
|
upload.save
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|