diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2013-12-24 10:18:54 +0100 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2013-12-24 10:18:54 +0100 |
commit | ec11807368318845a2542e8f5f51f3f5280135f5 (patch) | |
tree | 352a376a8ae1461ebd86b3206d4792a508c853ee /activerecord/lib/active_record/connection_handling.rb | |
parent | d2ed433b0af948da78e971bf342c506b27f6072f (diff) | |
download | rails-ec11807368318845a2542e8f5f51f3f5280135f5.tar.gz rails-ec11807368318845a2542e8f5f51f3f5280135f5.tar.bz2 rails-ec11807368318845a2542e8f5f51f3f5280135f5.zip |
Deprecate use of string in establish_connection as connection lookup
Diffstat (limited to 'activerecord/lib/active_record/connection_handling.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_handling.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_handling.rb b/activerecord/lib/active_record/connection_handling.rb index f274f74619..c4afadbd9b 100644 --- a/activerecord/lib/active_record/connection_handling.rb +++ b/activerecord/lib/active_record/connection_handling.rb @@ -32,6 +32,13 @@ module ActiveRecord # "postgres://myuser:mypass@localhost/somedatabase" # ) # + # In case <tt>ActiveRecord::Base.configurations</tt> is set (Rails + # automatically loads the contents of config/database.yml into it), + # a symbol can also be given as argument, representing a key in the + # configuration hash: + # + # ActiveRecord::Base.establish_connection(:production) + # # The exceptions AdapterNotSpecified, AdapterNotFound and ArgumentError # may be returned on an error. def establish_connection(spec = ENV["DATABASE_URL"]) |