Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Check env_url only once

  • Loading branch information...
commit d035ba143a46e64e6110b6a690e0655e8574fd49 1 parent 2b6d1da
@rafaelfranca rafaelfranca authored matthewd committed
Showing with 7 additions and 2 deletions.
  1. +7 −2 activerecord/lib/active_record/connection_handling.rb
View
9 activerecord/lib/active_record/connection_handling.rb
@@ -79,9 +79,14 @@ def config
if key.to_s == env
env_url = ENV["DATABASE_URL"]
end
+
env_url ||= ENV["DATABASE_URL_#{key.upcase}"]
- entry ||= {} if env_url
- entry.merge!("url" => env_url) { |h, v1, v2| v1 || v2 } if entry.is_a?(Hash) && env_url
+
+ if env_url
+ entry ||= {}
+ entry.merge!("url" => env_url) { |h, v1, v2| v1 || v2 } if entry.is_a?(Hash)
+ end
+
hash[key] = entry if entry
end
Please sign in to comment.
Something went wrong with that request. Please try again.