demarches-normaliennes/lib/tasks/2018_08_24_encrypt_tokens.rake
2018-09-27 10:14:32 +02:00

10 lines
248 B
Ruby

namespace :'2018_08_24_encrypt_tokens' do
task run: :environment do
Administrateur
.where
.not(api_token: nil)
.each do |admin|
admin.update(encrypted_token: BCrypt::Password.create(admin.api_token))
end
end
end