aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-02-25 08:34:16 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2014-02-25 08:34:16 -0800
commitb189f2846ada47a1b8094625fd7b30b3f32714d7 (patch)
tree2c96a85fd3b090f4d6bd6ca068126f98035bd725 /activerecord/lib/active_record
parent6d35190bad0b054c9a1f4c736dc4dda32a7ebc91 (diff)
parent283a2edec2f8ccdf90fb58025608f02a63948fa0 (diff)
downloadrails-b189f2846ada47a1b8094625fd7b30b3f32714d7.tar.gz
rails-b189f2846ada47a1b8094625fd7b30b3f32714d7.tar.bz2
rails-b189f2846ada47a1b8094625fd7b30b3f32714d7.zip
Merge pull request #14152 from schneems/schneems/fix-ar-wtf-why-is-there-no-environment
Handle missing environment from non empty config
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/connection_handling.rb14
1 files changed, 5 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/connection_handling.rb b/activerecord/lib/active_record/connection_handling.rb
index 11f6a47158..4ba4e09777 100644
--- a/activerecord/lib/active_record/connection_handling.rb
+++ b/activerecord/lib/active_record/connection_handling.rb
@@ -93,16 +93,12 @@ module ActiveRecord
# the connection URL. This hash responds to any string key with
# resolved connection information.
def default_url_hash
- if @raw_config.blank?
- Hash.new do |hash, key|
- hash[key] = if key.is_a? String
- ActiveRecord::ConnectionAdapters::ConnectionSpecification::ConnectionUrlResolver.new(@url).to_hash
- else
- nil
- end
+ Hash.new do |hash, key|
+ hash[key] = if key.is_a? String
+ ActiveRecord::ConnectionAdapters::ConnectionSpecification::ConnectionUrlResolver.new(@url).to_hash
+ else
+ nil
end
- else
- {}
end
end
end