From 8e315b0e0a551fcb09e73b2b704492923d4806f3 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 3 Apr 2012 12:23:32 -0400 Subject: DATABASE_URL allows omission of database.yml --- activerecord/lib/active_record/railtie.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb index 08cf9fb504..96dc258288 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -72,7 +72,9 @@ module ActiveRecord # and then establishes the connection. initializer "active_record.initialize_database" do |app| ActiveSupport.on_load(:active_record) do - self.configurations = app.config.database_configuration + unless ENV['DATABASE_URL'] + self.configurations = app.config.database_configuration + end establish_connection end end -- cgit v1.2.3