Rails Production Readonly Console

Using sandbox console in production can be dangerous because of locking, so I ended up implementing a toggle-able readonly mode, so by default the console is readonly unless the user opts-in to writing.

It’s not perfect (can be circumvented with crafted sql), but a lot simpler than setting up different credentials and switching the connection.

Leave a comment