aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-10-31 17:51:52 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-10-31 17:51:52 -0200
commit0dd99f1003980406c5b9ea7a2bbb4f97c68cdd9a (patch)
treefce8f3f9b7f97e6b8f861913db0fc5573366b033 /activerecord/lib
parent23a132960ce5cee88a35e090764318856b48ac16 (diff)
parent5024f6180afb19085d77e0378e1375a42a91d2b5 (diff)
downloadrails-0dd99f1003980406c5b9ea7a2bbb4f97c68cdd9a.tar.gz
rails-0dd99f1003980406c5b9ea7a2bbb4f97c68cdd9a.tar.bz2
rails-0dd99f1003980406c5b9ea7a2bbb4f97c68cdd9a.zip
Merge pull request #17305 from ziggythehamster/activerecord-connectionhandling-RAILS_ENV-without-rails
If Rails is not defined, check ENV["RAILS_ENV"] and ENV["RACK_ENV"] in ActiveRecord::ConnectionHandling
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_handling.rb2
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 31e7390bf7..8f51590c99 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) }
+ RAILS_ENV = -> { (Rails.env if defined?(Rails)) || ENV["RAILS_ENV"] || ENV["RACK_ENV"] }
DEFAULT_ENV = -> { RAILS_ENV.call || "default_env" }
# Establishes the connection to the database. Accepts a hash as input where