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 | |
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.
-rw-r--r-- | railties/CHANGELOG.md | 2 | ||||
-rw-r--r-- | railties/lib/rails.rb | 5 |
2 files changed, 1 insertions, 6 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 961d3dc450..e60c26d132 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -41,8 +41,6 @@ *Yves Senn* -* Ensure that `RAILS_ENV` is set when accessing Rails.env *Steve Klabnik* - * Add `.rake` to list of file extensions included by `rake notes` and `rake notes:custom`. *Brent J. Nordquist* * New test locations `test/models`, `test/helpers`, `test/controllers`, and 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) |