From efdc20f36ccc37afbb2705eb9acca76dd8aabd4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Sun, 4 Jan 2015 00:32:18 -0300 Subject: Remove deprecated access to connection specification using a string acessor. Now all strings will be handled as a URL. --- .../connection_adapters/connection_specification.rb | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/connection_adapters/connection_specification.rb b/activerecord/lib/active_record/connection_adapters/connection_specification.rb index e54e3199ff..08d46fca96 100644 --- a/activerecord/lib/active_record/connection_adapters/connection_specification.rb +++ b/activerecord/lib/active_record/connection_adapters/connection_specification.rb @@ -1,5 +1,4 @@ require 'uri' -require 'active_support/core_ext/string/filters' module ActiveRecord module ConnectionAdapters @@ -210,30 +209,12 @@ module ActiveRecord when Symbol resolve_symbol_connection spec when String - resolve_string_connection spec + resolve_url_connection spec when Hash resolve_hash_connection spec end end - def resolve_string_connection(spec) - # Rails has historically accepted a string to mean either - # an environment key or a URL spec, so we have deprecated - # this ambiguous behaviour and in the future this function - # can be removed in favor of resolve_url_connection. - if configurations.key?(spec) || spec !~ /:/ - ActiveSupport::Deprecation.warn(<<-MSG.squish) - Passing a string to ActiveRecord::Base.establish_connection for a - configuration lookup is deprecated, please pass a symbol - (#{spec.to_sym.inspect}) instead. - MSG - - resolve_symbol_connection(spec) - else - resolve_url_connection(spec) - end - end - # Takes the environment such as +:production+ or +:development+. # This requires that the @configurations was initialized with a key that # matches. -- cgit v1.2.3