Don’t use Rails console sandbox in production

user1 = User.first
mp1 = Micropost.first
user1.micropost = mp1
user1.save
user1.micropost #=> prints the mp1 instance object
rails console --sandbox
Loading development environment in sandbox (Rails 7.0.2.2)
Any modifications you make will be rolled back on exit

--

--

--

Software Engineer @ Shopify. Dad, rock climber, writer, something something. Big on learning everyday.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Docker+HTTPD+Python

Optimizing Delivery Routes

| Engineering News-Record

How to Update Docker Containers on a Synology NAS (with pictures)

[Java][LeetCode][Challenge] Word Subsets #916

Work with Apache Kafka in Spring Boot Application

Pandas Cheat Sheet

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nick Ang

Nick Ang

Software Engineer @ Shopify. Dad, rock climber, writer, something something. Big on learning everyday.

More from Medium

Test toggle states with RSpec

Generate your Apollo DataSources

An approach on data modeling in Ruby