Dynamically determine environment?

Does anyone know what the syntax is to determine the current environment
(prod, dev, etc.) in code?

if RAILS_ENV == ‘production’

On 7/23/07, blinking bear [email protected] wrote:

Does anyone know what the syntax is to determine the current environment
(prod, dev, etc.) in code?

I really love Coda Hale’s plugin:
http://blog.codahale.com/2006/04/09/rails-environments-a-plugin-for-well-rails/

It lets you do Rails.production? and Rails.development? etc. Reads so
nicely.


Chris W.
http://errfree.com // http://errtheblog.com

Thanks Chris, hadn’t heard of that one. I actually decided to just use
PJ’s
Cappin That Stat tip to only include the analytics code when deploying
to
the production server.

  • Nathan