SafeRailsConsole
Usage
Gemfile:
gem 'safe_rails_console'Then bundle install and add *_readonly section to database.yml:
common: &common
adapter: mysql2
encoding: utf8
reconnect: false
pool: 5
development:
<<: *common
database: youapp_development
username: root
password:
host: localhost
# Like this !!!
development_readonly:
<<: *common
database: youapp_development
username: readonly
password:
host: localhostFinally:
$ rails console --sandboxWill point to development_readonly database! Rocks!