diff options
author | Andy Lindeman <alindeman@gmail.com> | 2012-12-20 17:40:02 -0500 |
---|---|---|
committer | Andy Lindeman <alindeman@gmail.com> | 2012-12-21 17:22:57 -0500 |
commit | 33b3fa67c49715c98b37c737ec83937168aad859 (patch) | |
tree | 618b7bf94f64d65f25ef5af41785d63bf7b6d1e5 /railties/lib | |
parent | 4da76d7d4a67726a5cc484c13e43d4c5b170b916 (diff) | |
download | rails-33b3fa67c49715c98b37c737ec83937168aad859.tar.gz rails-33b3fa67c49715c98b37c737ec83937168aad859.tar.bz2 rails-33b3fa67c49715c98b37c737ec83937168aad859.zip |
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.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails.rb | 5 |
1 files changed, 1 insertions, 4 deletions
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) |