aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/connection_specification.rb
diff options
context:
space:
mode:
authorGrace Liu <graceliu@yahoo.com>2012-08-30 18:50:30 -0700
committerGrace Liu <graceliu@yahoo.com>2012-09-11 20:40:13 -0700
commit148c50b49a3db5e7516e8c465de4f68056912562 (patch)
tree3124b49a1320243152213d0bbb785e0e9088acfb /activerecord/lib/active_record/connection_adapters/connection_specification.rb
parent34b23e7110a3a13cf157608cefc9b5701017bf39 (diff)
downloadrails-148c50b49a3db5e7516e8c465de4f68056912562.tar.gz
rails-148c50b49a3db5e7516e8c465de4f68056912562.tar.bz2
rails-148c50b49a3db5e7516e8c465de4f68056912562.zip
fixed support for DATABASE_URL for rake db tasks
- added tests to confirm establish_connection uses DATABASE_URL and Rails.env correctly even when no arguments are passed in. - updated rake db tasks to support DATABASE_URL, and added tests to confirm correct behavior for these rake tasks. (Removed establish_connection call from some tasks since in those cases the :environment task already made sure the function would be called) - updated Resolver so that when it resolves the database url, it removes hash values with empty strings from the config spec (e.g. to support connection to postgresql when no username is specified).
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/connection_specification.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/connection_specification.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/connection_specification.rb b/activerecord/lib/active_record/connection_adapters/connection_specification.rb
index dd40351a38..b9a61f7d91 100644
--- a/activerecord/lib/active_record/connection_adapters/connection_specification.rb
+++ b/activerecord/lib/active_record/connection_adapters/connection_specification.rb
@@ -72,7 +72,7 @@ module ActiveRecord
:port => config.port,
:database => config.path.sub(%r{^/},""),
:host => config.host }
- spec.reject!{ |_,value| !value }
+ spec.reject!{ |_,value| value.blank? }
if config.query
options = Hash[config.query.split("&").map{ |pair| pair.split("=") }].symbolize_keys
spec.merge!(options)