aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-04-03 20:12:30 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2012-04-03 20:12:30 -0700
commitc4d31028f1c479c549b944610a52c2855d2e40e1 (patch)
treee87132a819c0d6b6e7ccf782b1bbf6c06dfd8b14 /activerecord
parent8e315b0e0a551fcb09e73b2b704492923d4806f3 (diff)
parentd46ad3460a5c8bffae1a907a11ba6ce3fec4de87 (diff)
downloadrails-c4d31028f1c479c549b944610a52c2855d2e40e1.tar.gz
rails-c4d31028f1c479c549b944610a52c2855d2e40e1.tar.bz2
rails-c4d31028f1c479c549b944610a52c2855d2e40e1.zip
Merge pull request #5727 from hone/ar_database_url_logging
ActiveRecord configuration logging
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/railtie.rb4
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