rails console
Running via Spring preloader in process 71286
Loading development environment ( Rails 6.0 .3 .4 )
2.6 .4 : 001 >
2.6 .4 : 002 > User . all. to_a
( 0.5 ms) SET NAMES utf8, @@SESSION . sql_mode = CONCAT ( CONCAT ( @@sql_mode , ',STRICT_ALL_TABLES' ) , ',NO_AUTO_VALUE_ON_ZERO' ) , @@SESSION . sql_auto_is_null = 0 , @@SESSION . wait_timeout = 2147483
User Load ( 0.4 ms) SELECT `users`. * FROM `users`
= > [
2.6 .4 : 004 > user= User . first
User Load ( 0.4 ms) SELECT `users`. * FROM `users` ORDER BY `users`. `id` ASC LIMIT 1
= >
2.6 .4 : 005 > user. id
= > 2
2.6 .4 : 006 > user. username
= > "root"
2.6 .4 : 007 > user. username = 'admin'
= > "admin"
2.6 .4 : 008 > user. save
( 0.2 ms) BEGIN
User Update ( 0.5 ms) UPDATE `users` SET `users`. `username` = 'admin' , `users`. `updated_at` = '2020-12-07 00:54:07.331518' WHERE `users`. `id` = 2
( 1.9 ms) COMMIT
= > true
2.6 .4 : 009 > user. username
= > "admin"
2.6 .4 : 010 > user. destroy
( 0.2 ms) BEGIN
User Destroy ( 0.3 ms) DELETE FROM `users` WHERE `users`. `id` = 2
( 1.0 ms) COMMIT
= >
2.6 .4 : 011 >