Apply automatic rubocop fixes

This commit is contained in:
Sebastian Serth
2021-05-14 10:51:44 +02:00
parent fe4000916c
commit 6cbecb5b39
440 changed files with 2705 additions and 1853 deletions

View File

@@ -1,17 +1,17 @@
# frozen_string_literal: true
namespace :user do
require 'csv'
require 'csv'
desc 'write displaynames retrieved from the account service as csv into the codeocean database'
task :write_displaynames, [:file_path_read] => [ :environment ] do |t, args|
desc 'write displaynames retrieved from the account service as csv into the codeocean database'
csv_input = CSV.read(args[:file_path_read], headers:true)
task :write_displaynames, [:file_path_read] => [:environment] do |_t, args|
csv_input = CSV.read(args[:file_path_read], headers: true)
csv_input.each do |row|
user = ExternalUser.find_by(:external_id => row[0])
user = ExternalUser.find_by(external_id: row[0])
puts "Change name from #{user.name} to #{row[1]}"
user.update(name: row[1])
end
end
end