Permalink
Browse files

DATABASE_URL allows omission of database.yml

  • Loading branch information...
1 parent 3b378a7 commit a49944844fad2edf10ba833937c05f9d9c61d132 @tpope tpope committed with tenderlove Apr 3, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/lib/active_record/railtie.rb
@@ -68,7 +68,9 @@ class Railtie < Rails::Railtie
# 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

0 comments on commit a499448

Please sign in to comment.