how can I get what enviornment is currently running from a controller?.. like development, test, production, etc. thanks..
on 2007-07-16 01:00
on 2007-07-16 01:42
I'd like to know this also. I need to know how force a rake task to pick up an environment other than 'production' on my production host. I renamed my environment to something more specific, but "rake db:migrate" always uses the configuration under the "production" environment... On Jul 15, 2:00 pm, Aaron S. <email@example.com>
on 2007-07-16 01:59
Ah, google actually had the answer to my question: rake db:migrate RAILS_ENV=my_production_env
on 2007-07-16 02:03
zaven wrote: > Ah, google actually had the answer to my question: > rake db:migrate RAILS_ENV=my_production_env I'm looking to find out how you access this in a controller. is it still RAILS_ENV?
on 2007-07-16 02:56
if you take a look at your rails gem. in rails/lib/initializer.rb, line 12-ish, there's the following; RAILS_ENV = (ENV['RAILS_ENV'] || 'development').dup unless defined?(RAILS_ENV) So, indeed, calling RAILS_ENV from anywhere inside you app will return the environment. Aaron S. wrote: > zaven wrote: >> Ah, google actually had the answer to my question: >> rake db:migrate RAILS_ENV=my_production_env > > I'm looking to find out how you access this in a controller. is it still > RAILS_ENV?