Apply automatic rubocop fixes
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user