Api Token: encrypt current tokens

This commit is contained in:
simon lehericey 2018-08-24 16:47:18 +02:00
parent 8c4f8347ca
commit 84abfa209c

View file

@ -0,0 +1,10 @@
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