another thing I find useful when working with Rails console is the sandbox mode rails console --sandbox. When starting the Rails console in sandbox mode, the entire session will be wrapped in a transaction, and gets rolled back when you exit the console. This is nice when we want to mutate some records for testing purpose and not mess up our development/production data.
An aspiring artist using code as another medium for creation. I am currently a software developer in an EdTech company focused on improving communication in the workplace. I work heavily in Ruby!
another thing I find useful when working with Rails console is the sandbox mode
rails console --sandbox
. When starting the Rails console in sandbox mode, the entire session will be wrapped in a transaction, and gets rolled back when you exit the console. This is nice when we want to mutate some records for testing purpose and not mess up our development/production data.Ahh nice! I didn't know you could do that!