diff options
author | Steve Klabnik <steve@steveklabnik.com> | 2012-10-24 15:04:12 -0700 |
---|---|---|
committer | Steve Klabnik <steve@steveklabnik.com> | 2012-10-31 17:05:26 -0700 |
commit | b3125c89f42968bec6ee0b92ab93e36dbc36d5c3 (patch) | |
tree | cae75db71b555c52e6f37595f229c75100df6181 /railties/lib | |
parent | d3494903719682abc0948bef290af0d3d7b5a440 (diff) | |
download | rails-b3125c89f42968bec6ee0b92ab93e36dbc36d5c3.tar.gz rails-b3125c89f42968bec6ee0b92ab93e36dbc36d5c3.tar.bz2 rails-b3125c89f42968bec6ee0b92ab93e36dbc36d5c3.zip |
Make sure that RAILS_ENV is set when accessing Rails.env
Fixes #8025
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/railties/lib/rails.rb b/railties/lib/rails.rb index dd51a6fb01..6bf2d8db20 100644 --- a/railties/lib/rails.rb +++ b/railties/lib/rails.rb @@ -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) |