Sometimes we want to test something in console without affecting website and storing changes permanently.
Rails console has special mode for such situations called “sandbox mode”. It can be enabled using sandbox argument.
rails c --sandbox
All database changes made in “sandbox mode” will be rolled back after closing console.