Ruby On Rails console sandbox mode

Ruby On Rails console sandbox mode

If you want to perform some data migration/modification on production and you want to be sure that it will not break anything you can always perform a test run using rails console with --sandbox flag.

After entering console with

rails console production --sandbox

you will get following information

Loading production environment in sandbox (Rails X.X.X)
Any modifications you make will be rolled back on exit

You can now safely perform data migration and check if everything is OK.

Leave a comment

Plain text only. Comment must be over 20 characters.

Join the newsletter

I write about Ruby on Rails, and Web programming. Join other developers in keeping up with my content. Unsubscribe whenever. Never any spam, ads, or affiliate links.