diff options
author | Tim Pope <code@tpope.net> | 2012-04-03 12:23:32 -0400 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-04-03 15:57:18 -0700 |
commit | 8e315b0e0a551fcb09e73b2b704492923d4806f3 (patch) | |
tree | 60761ebdc4797c2121d54753b81f69de466ced04 /activerecord/lib/active_record | |
parent | 515e1d33f25a75dee0726dab67a1469f5a4ce813 (diff) | |
download | rails-8e315b0e0a551fcb09e73b2b704492923d4806f3.tar.gz rails-8e315b0e0a551fcb09e73b2b704492923d4806f3.tar.bz2 rails-8e315b0e0a551fcb09e73b2b704492923d4806f3.zip |
DATABASE_URL allows omission of database.yml
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/railtie.rb | 4 |
1 files changed, 3 insertions, 1 deletions
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 |