提交 1e89e43f 编写于 作者: C Carlos Antonio da Silva

Merge pull request #8026 from steveklabnik/issue_8025

Make sure that RAILS_ENV is set when accessing Rails.env
## 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*
......
......@@ -85,7 +85,10 @@ def root
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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册