houdini_upgrade:migrate_uploads always writes out a success and error file now
This commit is contained in:
parent
3a1c15f115
commit
fdb32cbbf3
1 changed files with 10 additions and 10 deletions
|
@ -75,7 +75,7 @@ RUBY
|
|||
end
|
||||
|
||||
desc "Migrate your CarrierWave uploads to activestorage"
|
||||
task :migrate_uploads, [:write_out_to_files] => [:environment] do |t, args|
|
||||
task :migrate_uploads => [:environment] do |t, args|
|
||||
progress_bar = ProgressBar.new(0, "Upload migration progress")
|
||||
results = []
|
||||
Rails.application.eager_load!
|
||||
|
@ -98,7 +98,7 @@ RUBY
|
|||
|
||||
copied = results.select{|i| i[:success]}.map{|i| i[:value]}
|
||||
errors = results.select{|i| !i[:success]}.map{|i| i[:value]}
|
||||
if args.write_out_to_files
|
||||
|
||||
CSV.open('copied.csv', 'wb') do |csv|
|
||||
csv << ['Name', 'Id', "UploaderName", "FileToOpen", "CodeToRun"]
|
||||
copied.each {|row| csv << row}
|
||||
|
@ -108,7 +108,7 @@ RUBY
|
|||
csv << ['Name', 'Id', "UploaderName", "Error"]
|
||||
errors.each {|row| csv << row}
|
||||
end
|
||||
end
|
||||
|
||||
puts "Copied: #{copied.count}"
|
||||
puts "Errored: #{errors.count}"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue