Can I specify in database.yml that a rails environment should have readonly access to the DB? -


we have app pretty standard database configuration. on live servers, if want query contents of database have run script/console production or script/dbconsole production , risk accidentally modifying our data. create new rails environment readonly access same database, can run script/console readonly or script/dbconsole readonly without risk. i've seen solutions involve adding new mysql user, or monkey patching activerecord::base. don't want - want specify in database.yml connection database should readonly. possible, , if so, how do it? i've tried adding readonly: true it's ignored.

you can use console in sandbox mode. in sandbox mode, database changes made while in console reverted when exit console.

$ script/console --sandbox 

you can't specify readonly mode in database.yml.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -