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:01 -0700 |
commit | a49944844fad2edf10ba833937c05f9d9c61d132 (patch) | |
tree | 7dbc9ef25cd85eab5784fb2d802cdf597b7fd844 /activerecord/lib/active_record | |
parent | 3b378a7840c8c2a46935c73dc56d94d4b6fcee9e (diff) | |
download | rails-a49944844fad2edf10ba833937c05f9d9c61d132.tar.gz rails-a49944844fad2edf10ba833937c05f9d9c61d132.tar.bz2 rails-a49944844fad2edf10ba833937c05f9d9c61d132.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 e94b67cbdc..eb2769f1ef 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -68,7 +68,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 |