diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-05-25 00:00:08 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-05-25 00:00:08 +0900 |
commit | 8ace8c76a4d90cca29ede40dbc7f81351eb2e137 (patch) | |
tree | d00d0c973c1b4edfb5c2e9ae585b7382b095f807 /activerecord/lib | |
parent | 3a628b9338c436001c00a9865b22036abd44a2bd (diff) | |
download | rails-8ace8c76a4d90cca29ede40dbc7f81351eb2e137.tar.gz rails-8ace8c76a4d90cca29ede40dbc7f81351eb2e137.tar.bz2 rails-8ace8c76a4d90cca29ede40dbc7f81351eb2e137.zip |
`DEFAULT_ENV` falls back to `default_env` when `RAILS_ENV` or `RACK_ENV` is an empty string
Follow up of #27399.
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 |