diff --git a/db/migrate/20230301024452_encrypt_api_key.rb b/db/migrate/20230301024452_encrypt_api_key.rb index e9d1fb070..7ce08243c 100644 --- a/db/migrate/20230301024452_encrypt_api_key.rb +++ b/db/migrate/20230301024452_encrypt_api_key.rb @@ -16,7 +16,7 @@ def change def encrypt_api_keys connection.select_all("SELECT id, api_key FROM users").each do |user| - encrypted_api_key = ActiveRecord::Encryption.encrypt(user["api_key"]) + encrypted_api_key = ActiveRecord::Encryption.encryptor.encrypt(user["api_key"]) connection.update("UPDATE users SET api_key = #{connection.quote(encrypted_api_key)} WHERE id = #{user['id']}") end end