diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2017-05-28 23:59:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-28 23:59:59 -0500 |
commit | 7a3db2ea15970e4c9c31a2b23303928aeadb391d (patch) | |
tree | db6c621d4be92b0c677035e4c09f5d7613ef5c13 /activerecord/lib | |
parent | 109bca95022d9471c0aafb9efeb4ba8eb6d99832 (diff) | |
parent | 8ace8c76a4d90cca29ede40dbc7f81351eb2e137 (diff) | |
download | rails-7a3db2ea15970e4c9c31a2b23303928aeadb391d.tar.gz rails-7a3db2ea15970e4c9c31a2b23303928aeadb391d.tar.bz2 rails-7a3db2ea15970e4c9c31a2b23303928aeadb391d.zip |
Merge pull request #29208 from kamipo/default_env_fall_back_to_default_env_when_rails_env_or_rack_env_is_empty_string
`DEFAULT_ENV` falls back to `default_env` when `RAILS_ENV` or `RACK_ENV` is an empty string
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_handling.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_handling.rb b/activerecord/lib/active_record/connection_handling.rb index 2ede92feff..b8fbb489b6 100644 --- a/activerecord/lib/active_record/connection_handling.rb +++ b/activerecord/lib/active_record/connection_handling.rb @@ -1,6 +1,6 @@ module ActiveRecord module ConnectionHandling - RAILS_ENV = -> { (Rails.env if defined?(Rails.env)) || ENV["RAILS_ENV"] || ENV["RACK_ENV"] } + RAILS_ENV = -> { (Rails.env if defined?(Rails.env)) || ENV["RAILS_ENV"].presence || ENV["RACK_ENV"].presence } DEFAULT_ENV = -> { RAILS_ENV.call || "default_env" } # Establishes the connection to the database. Accepts a hash as input where |