diff options
Diffstat (limited to 'activerecord/lib/active_record/railtie.rb')
-rw-r--r-- | activerecord/lib/active_record/railtie.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb index 96dc258288..13b7c6e214 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -72,9 +72,13 @@ module ActiveRecord # and then establishes the connection. initializer "active_record.initialize_database" do |app| ActiveSupport.on_load(:active_record) do + db_connection_type = "DATABASE_URL" unless ENV['DATABASE_URL'] + db_connection_type = "database.yml" self.configurations = app.config.database_configuration end + Rails.logger.info "Connecting to database specified by #{db_connection_type}" + establish_connection end end |