From 4605b5639db4fa15f8b6627245c74b899241f38a Mon Sep 17 00:00:00 2001 From: Glenn Gillen Date: Mon, 25 Jul 2011 10:21:56 +0100 Subject: Simplify the way default DATABASE_URL works. --- .../connection_adapters/abstract/connection_specification.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/connection_adapters') diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb index 123b3654e6..7312e34f01 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb @@ -54,7 +54,7 @@ module ActiveRecord # # The exceptions AdapterNotSpecified, AdapterNotFound and ArgumentError # may be returned on an error. - def self.establish_connection(spec = nil) + def self.establish_connection(spec = ENV["DATABASE_URL"]) case spec when nil raise AdapterNotSpecified unless defined?(Rails.env) -- cgit v1.2.3