1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Make sure that RAILS_ENV is set when accessing Rails.env

Fixes #8025
This commit is contained in:
Steve Klabnik 2012-10-24 15:04:12 -07:00
parent d349490371
commit b3125c89f4
2 changed files with 6 additions and 1 deletions

View file

@ -1,5 +1,7 @@
## Rails 4.0.0 (unreleased) ##
* Ensure that RAILS_ENV is set when accessing Rails.env *Steve Klabnik*
* Don't eager-load app/assets and app/views *Elia Schito*
* Add `.rake` to list of file extensions included by `rake notes` and `rake notes:custom`. *Brent J. Nordquist*

View file

@ -85,7 +85,10 @@ module Rails
end
def env
@_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development")
@_env ||= begin
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"])
end
end
def env=(environment)