diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-26 12:47:33 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-28 23:47:16 -0200 |
commit | a119dd377556cd0f636f0d69e55ddf6ab3443623 (patch) | |
tree | 240e14b93b423cdae6492a91b2f3ad8e593118f4 /activerecord/lib/active_record/connection_adapters | |
parent | 37586ddf279c46c3d0c8c2553d0918aa82ceb020 (diff) | |
download | rails-a119dd377556cd0f636f0d69e55ddf6ab3443623.tar.gz rails-a119dd377556cd0f636f0d69e55ddf6ab3443623.tar.bz2 rails-a119dd377556cd0f636f0d69e55ddf6ab3443623.zip |
Merge pull request #7593 from veader/patch-1
Decode attributes pulled from URI.parse
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/connection_adapters/connection_specification.rb
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb index 6c8a102caf..63ab470fff 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb @@ -68,6 +68,8 @@ module ActiveRecord :database => config.path.sub(%r{^/},""), :host => config.host } spec.reject!{ |_,value| !value } + uri_parser = URI.const_defined?(:Parser) ? URI::Parser.new : URI + spec.map { |key,value| spec[key] = uri_parser.unescape(value) if value.is_a?(String) } if config.query options = Hash[config.query.split("&").map{ |pair| pair.split("=") }].symbolize_keys spec.merge!(options) |