From 33b3fa67c49715c98b37c737ec83937168aad859 Mon Sep 17 00:00:00 2001 From: Andy Lindeman Date: Thu, 20 Dec 2012 17:40:02 -0500 Subject: Revert "Make sure that RAILS_ENV is set when accessing Rails.env" This reverts commit b3125c89f42968bec6ee0b92ab93e36dbc36d5c3. * It is not desirable to set `ENV['RAILS_ENV']`; otherwise, it will leak through to rake tasks such as `rake test` or `rake spec`. See #7175 for more details. --- railties/lib/rails.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'railties/lib') diff --git a/railties/lib/rails.rb b/railties/lib/rails.rb index 2797205334..ac8e84e366 100644 --- a/railties/lib/rails.rb +++ b/railties/lib/rails.rb @@ -72,10 +72,7 @@ module Rails end def env - @_env ||= begin - ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" - ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"]) - end + @_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development") end def env=(environment) -- cgit v1.2.3